Merge lp:~openerp-dev/openerp-web/6.1-opw-578688-msh into lp:openerp-web/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-578688-msh
Merge into: lp:openerp-web/6.1
Diff against target: 16 lines (+5/-1)
1 file modified
addons/web/static/src/js/view_form.js (+5/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-578688-msh
Reviewer Review Type Date Requested Status
Mohammed Shekha(Open ERP) (community) Disapprove
Jiten (OpenERP) (community) Abstain
OpenERP Core Team Pending
Review via email: mp+123677@code.launchpad.net

Description of the change

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(Example)

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.

To post a comment you must log in.
Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

The same is fixed from server in the branch lp:~openerp-dev/openobject-server/6.1-bug-invisible_modifiers-xal.

Hence this branch is not useful now.

Thanks.

Revision history for this message
Jiten (OpenERP) (jiten-openerp) :
review: Abstain
Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

As this is already fixed in lp:~openerp-dev/openobject-server/6.1-bug-invisible_modifiers-xal.

Hence rejecting this branch.

Thanks.

review: Disapprove

Unmerged revisions

2455. By Mohammed Shekha(Open ERP)

[FIX]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.

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 2012-09-03 13:17:44 +0000
3+++ addons/web/static/src/js/view_form.js 2012-09-11 05:01:20 +0000
4@@ -917,7 +917,11 @@
5 op, JSON.stringify(expr));
6 }
7 }
8- return _.all(stack, _.identity);
9+ if(stack.length){
10+ return _.any(stack, _.identity);
11+ }else{
12+ return _.all(stack, _.identity);
13+ }
14 };
15
16 openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.form.Widget# */{