details: https://code.openbravo.com/erp/devel/pi/rev/5a980493ea05
changeset: 21408:5a980493ea05
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Wed Oct 30 23:39:07 2013 +0100
summary: Fixes issue 25049: Filter "and" clause is not working ok
This happened because a criterion with an 'and' operation does not include the
fieldName as a root property. This property can be accessed from any of its
inner criteria.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
| 15 +++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diffs (25 lines):
diff -r e5445b0f76a3 -r 5a980493ea05
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
Wed Oct 30 20:46:49 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
Wed Oct 30 23:39:07 2013 +0100
@@ -236,7 +236,20 @@
},
canEditCriterion: function (criterion) {
- return criterion && (criterion.fieldName === this.name ||
(this.criteriaField && (criterion.fieldName === this.criteriaField)));
+ var firstCriteria;
+ if (criterion.operator === 'and') {
+ // and operator does not include the fieldName as a root property
+ if (!criterion.criteria || criterion.criteria.length === 0) {
+ return true;
+ } else {
+ // all criteria of the criterion are associated with the same name,
pick the first
+ firstCriteria = criterion.criteria[0];
+ return (firstCriteria.fieldName === this.name || (this.criteriaField
&& (firstCriteria.fieldName === this.criteriaField)));
+ }
+
+ } else {
+ return criterion && (criterion.fieldName === this.name ||
(this.criteriaField && (criterion.fieldName === this.criteriaField)));
+ }
},
getCriterion: function (textMatchStyle) {
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits