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

Proposed by Mohammed Shekha(Open ERP) on 2013-10-29
Status: Rejected
Rejected by: Martin Trigaux (OpenERP) on 2014-02-10
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) 2013-10-29 Disapprove on 2014-02-10
Antony Lesuisse (OpenERP) 2013-10-29 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.

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> on 2013-10-29

[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
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2013-10-10 09:11:25 +0000
3+++ addons/web/static/src/js/view_form.js 2013-10-29 12:33:10 +0000
4@@ -5452,17 +5452,17 @@
5 }
6 });
7 },
8+ set_value_selected: function(val) {
9+ this.set({'value': val});
10+ },
11 on_click_stage: function (ev) {
12 var self = this;
13 var $li = $(ev.currentTarget);
14 var val = parseInt($li.data("id"));
15 if (val != self.get('value')) {
16+ this.set_value_selected(val)
17 this.view.recursive_save().done(function() {
18- var change = {};
19- change[self.name] = val;
20- self.view.dataset.write(self.view.datarecord.id, change).done(function() {
21- self.view.reload();
22- });
23+ self.view.reload();
24 });
25 }
26 },