Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-578688-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-578688-msh/+merge/123510
Hello,
Fixed the issue of states and attrs clashing when one of expression of
modifiers goes to true, currently if there are two expressions in modifiers so
if bith pass the truth test then and then returns true, but it should be oring
intead of anding, if I am setting my field invisible with attrs as well as
states and if both condition are clashing then it should consider true one that
is if one of expression goes true web should make my field invisible because as
a developer my intension was to invisible in one of expression.
Demo :- Go to any view in which there is states on field and now put attrs on
that field like follow
invisible=True(in .py) states="draft, assign, confirmed" attrs="{invisible:
[('state', '=', 'confirmed')]}"
So according to above modifiers will be.
[["state", "=", "confirmed"], ["state", "not in", ["draft", "assigned",
"confirmed"]]]
So when state is 'confirmed' the field should be invisible(expression-1) and
according to expression-2 field should invisible when field not confirmed.
Currently Web-client is use 'and' instead 'or' should be used because in any
case developer has think to make field invisible.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-578688-msh/+merge/123510
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-578688-msh.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-09-03 13:17:44 +0000
+++ addons/web/static/src/js/view_form.js 2012-09-10 09:18:54 +0000
@@ -917,7 +917,7 @@
op, JSON.stringify(expr));
}
}
- return _.all(stack, _.identity);
+ return _.any(stack, _.identity);
};
openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.form.Widget# */{
_______________________________________________
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