Merge lp:~openerp-dev/openerp-web/7.0-opw-599980-msh into lp:openerp-web/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Rejected
Rejected by: Martin Trigaux (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-599980-msh
Merge into: lp:openerp-web/7.0
Diff against target: 26 lines (+5/-5)
1 file modified
addons/web/static/src/js/view_form.js (+5/-5)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-599980-msh
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Disapprove
Antony Lesuisse (OpenERP) Pending
Review via email: mp+193049@code.launchpad.net

Description of the change

Hello,

Fixed the issue of statubar doesn't call on_change.

Demo: Defined on_change attrs on any statusbar widget field and then click on that statusbar.

Result it will not call on_change method
Expected: It should call on_change and then set the value of on_change result and the statusbar should call recursive_save and reload_view.

For reference go through following bug:
https://bugs.launchpad.net/openerp-web/+bug/1175960

Also after setting value in field there is no need to call write explicitly because recursive_save will do the job of write, so removing explicit call of write.

Thanks.

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

Sorry but I wil lreject this as the bug is a feature request (we want to keep the current behaviour).
See the bug report for more details.

Regards

review: Disapprove

Unmerged revisions

4049. By Mohammed Shekha(OpenERP)<email address hidden>

[FIX]Web: Fixed the issue of statusbar, clicking on statusbar does not call on_change method.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2013-10-10 09:11:25 +0000
+++ addons/web/static/src/js/view_form.js 2013-10-29 12:33:10 +0000
@@ -5452,17 +5452,17 @@
5452 }5452 }
5453 });5453 });
5454 },5454 },
5455 set_value_selected: function(val) {
5456 this.set({'value': val});
5457 },
5455 on_click_stage: function (ev) {5458 on_click_stage: function (ev) {
5456 var self = this;5459 var self = this;
5457 var $li = $(ev.currentTarget);5460 var $li = $(ev.currentTarget);
5458 var val = parseInt($li.data("id"));5461 var val = parseInt($li.data("id"));
5459 if (val != self.get('value')) {5462 if (val != self.get('value')) {
5463 this.set_value_selected(val)
5460 this.view.recursive_save().done(function() {5464 this.view.recursive_save().done(function() {
5461 var change = {};5465 self.view.reload();
5462 change[self.name] = val;
5463 self.view.dataset.write(self.view.datarecord.id, change).done(function() {
5464 self.view.reload();
5465 });
5466 });5466 });
5467 }5467 }
5468 },5468 },