Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-574229-msh into lp:openerp-web/6.1.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-574229-msh/+merge/104229
Hello,
Fixed the issue of many2one on_change which returns osv_exception, so the value
of many2one field should again changed to old value.
Demo:- First modify any on_change or open the form where many2one on_change
returns osv_exception to test this issue, say for example I have changed the
onchange_partner_id method and raised an osv_exception from here,
Now I go to sale order and changed the partner_id many2one and selected a value
which raising an exception, so it will show you a popup with message but the
value of many2one will be selected value even though exception raised.
As this can be fixed by overwriting a name_get from addons, but as GTK supports
this, so to make the same behavior for both client, fixed it from web.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-574229-msh/+merge/104229
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-574229-msh.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-04-20 11:28:12 +0000
+++ addons/web/static/src/js/view_form.js 2012-05-01 10:34:31 +0000
@@ -1420,7 +1420,10 @@
this.validate();
if (this.is_valid()) {
this.set_value_from_ui();
- this.view.do_onchange(this);
+ can_process_further = this.view.do_onchange(this);
+ if(can_process_further.isRejected()){
+ return can_process_further;
+ }
this.view.on_form_changed(true);
this.view.do_notify_change();
} else {
@@ -2137,7 +2140,10 @@
}
if (this.value !== undefined && ((back_orig_value ? back_orig_value[0] : null)
!== (this.value ? this.value[0] : null))) {
- this.on_ui_change();
+ should_back_orig_value = this.on_ui_change();
+ if(should_back_orig_value && should_back_orig_value.isRejected()){
+ this._change_int_ext_value(back_orig_value)
+ }
}
},
set_value: function(value) {
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp