Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-577592-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-577592-msh/+merge/118240

Hello,

Fix the issue of many2one field which does not become dirty when we remove the 
text from it.

Demo ;- Sale -> Sale order -> open existing one in which there is a value in 
Contract/Analytic Account field, now remove that field will not make field 
dirty(so not form dirty).

Reason :- Comparison of null and undefined is bit confusing, see follow example.

>>> var a
undefined
>>> var b = null
undefined
>>> a == b
true
>>> a != b
false

So the condition will become false in _change_int_value(this.value !== 
undefined), hence checked both !== operator.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-577592-msh/+merge/118240
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-577592-msh.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2012-07-20 12:48:22 +0000
+++ addons/web/static/src/js/view_form.js	2012-08-04 12:00:26 +0000
@@ -2295,7 +2295,7 @@
         if (back_orig_value === undefined) { // first use after a set_value()
             return;
         }
-        if (this.value != undefined && ((back_orig_value ? back_orig_value[0] : null)
+        if (this.value !== undefined && ((back_orig_value ? back_orig_value[0] : null)
                 !== (this.value ? this.value[0] : null))) {
             this.on_ui_change();
         }

_______________________________________________
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

Reply via email to