Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0031268 | Retail Modules | Web POS | public | 2015-10-27 13:27 | 2015-10-28 16:06 |
Reporter | adrianromero | ||||
Assigned To | adrianromero | ||||
Priority | urgent | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | RR16Q1 | |||
Merge Request Status | |||||
Review Assigned To | marvintm | ||||
OBNetwork customer | No | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0031268: SimpleQueryBuilder replacement order of criterias is incorrect. | ||||
Description | The order of replacement tags provided by SimpleQueryBuilder is not correct. The problem is that $filtersCriteria and $hqlCriteria are the last tags to be replaced but the filters defined in $filtersCriteria and $hqlCriteria may contain tags that has been replaced previously so will not be replaced | ||||
Steps To Reproduce | This is the current order of replacement in getHQLQuery() https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/8e517c8e2c1c/src/org/openbravo/mobile/core/process/SimpleQueryBuilder.java#l429 [^] For example filtering Business Partners in the Business Partners list in POS, the LocName (Localization Name) property includes the tags $naturalOrgCriteria and $readableSimpleClientCriteria that are not processed because the $filtersCriteria is replaced at the end ant the following error is raised: serviceSuccess error: status: -1, error.message: unexpected AST node: . near line 34, column 725 [SELECT bpl.businessPartner.id as id, bpl.businessPartner.organization.id as organization, bpl.businessPartner.name as name, bpl.businessPartner.name as _identifier, bpl.businessPartner.searchKey as searchKey, bpl.businessPartner.description as description, bpl.businessPartner.taxID as taxID, bpl.businessPartner.sOBPTaxCategory.id as taxCategory, bpl.businessPartner.priceList.id as priceList, bpl.businessPartner.paymentMethod.id as paymentMethod, bpl.businessPartner.paymentTerms.id as paymentTerms, bpl.businessPartner.invoiceTerms as invoiceTerms, (select max(bpls.id) as bpLocId from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.invoiceToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as locId, (select max(bpls.id) as bpLocId from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.shipToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as locShipId, (select max(COALESCE(bpls.locationAddress.addressLine1, bpls.locationAddress.addressLine2, bpls.locationAddress.postalCode, bpls.locationAddress.cityName)) from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.invoiceToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as locName, (select max(COALESCE(bpls.locationAddress.addressLine1, bpls.locationAddress.addressLine2, bpls.locationAddress.postalCode, bpls.locationAddress.cityName)) as nameShipTo from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.shipToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as locShipName, ulist.email as email, ulist.id as contactId, ulist.phone as phone, ulist.firstName as firstName, ulist.lastName as lastName, plist.priceIncludesTax as priceIncludesTax, plist.name as priceListName, (select max(bpls.locationAddress.cityName) from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.shipToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as cityName, (select max(bpls.locationAddress.postalCode) from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.shipToAddress = true and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) as postalCode, bpl.locationAddress.country.name as countryName, bpl.businessPartner.businessPartnerCategory.id as businessPartnerCategory, bpl.businessPartner.businessPartnerCategory.name as businessPartnerCategory_name, bpl.businessPartner.creditLimit as creditLimit, bpl.businessPartner.creditUsed as creditUsed, bpl.businessPartner.taxExempt as taxExempt, bpl.businessPartner.customerBlocking as customerBlocking, bpl.businessPartner.salesOrder as salesOrderBlocking, (case when bpl.active = 'Y' and bpl.businessPartner.active = 'Y' then true else false end) as active FROM BusinessPartnerLocation AS bpl left outer join bpl.businessPartner.aDUserList AS ulist left outer join bpl.businessPartner.priceList AS plist WHERE ( (upper(bpl.businessPartner.searchKey) like upper('b%') OR upper(bpl.businessPartner.name) like upper('b%') OR upper(bpl.businessPartner.taxID) like upper('b%') OR upper((select max(COALESCE(bpls.locationAddress.addressLine1, bpls.locationAddress.addressLine2, bpls.locationAddress.postalCode, bpls.locationAddress.cityName)) as nameShipTo from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.shipToAddress = true and bpls.$readableSimpleClientCriteria AND bpls.$naturalOrgCriteria group by bpls.businessPartner.id)) like upper('b%') OR upper((select max(COALESCE(bpls.locationAddress.addressLine1, bpls.locationAddress.addressLine2, bpls.locationAddress.postalCode, bpls.locationAddress.cityName)) from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and bpls.invoiceToAddress = true and bpls.$readableSimpleClientCriteria AND bpls.$naturalOrgCriteria group by bpls.businessPartner.id)) like upper('b%') OR upper(ulist.phone) like upper('b%') OR upper(ulist.email) like upper('b%')) ) AND bpl.businessPartner.customer = true AND bpl.businessPartner.priceList IS NOT NULL AND ( (bpl.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpl.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) AND (( (bpl.active = 'Y') ) AND ( (bpl.businessPartner.active = 'Y') )) and bpl.id in (select max(bpls.id) as bpLocId from BusinessPartnerLocation AS bpls where bpls.businessPartner.id=bpl.businessPartner.id and ( (bpls.client.id in ('39363B0921BB4293B48383844325E84C', '0')) ) AND (bpls.organization.id in ('D270A5AC50874F8BA67A88EE977F8E3B', '0', '14B1927026BE471E9B85FE699BCA61C2', '67839EEFA49E44AC969BD60093FCC899', 'BF129721D9FB4EB0819509934153E972')) group by bpls.businessPartner.id) and (not exists (select 1 from ADUser usr where usr.businessPartner = bpl.businessPartner)) ORDER BY bpl.businessPartner.name]; line: serviceSuccess (http://localhost:8080/openbravo/web/js/gen/5a4256db9f784eed43bd8859d6f8b899_WebPOS.js:1033:10 [^]) (*,+) | ||||
Proposed Solution | Put the lines that executes the replacement of $filtersCriteria and $hqlCriteria at the very beginning of the method getHQLQuery() in class SimpleQueryBuilder See the attached diff. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=8649&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-10-27 13:27 | adrianromero | New Issue | |||
2015-10-27 13:27 | adrianromero | Assigned To | => adrianromero | ||
2015-10-27 13:27 | adrianromero | OBNetwork customer | => No | ||
2015-10-27 13:27 | adrianromero | Triggers an Emergency Pack | => No | ||
2015-10-27 13:37 | adrianromero | Proposed Solution updated | |||
2015-10-27 13:38 | adrianromero | File Added: issue31268.diff | |||
2015-10-27 13:58 | adrianromero | Review Assigned To | => marvintm | ||
2015-10-27 16:03 | hgbot | Checkin | |||
2015-10-27 16:03 | hgbot | Note Added: 0081355 | |||
2015-10-27 16:03 | hgbot | Status | new => resolved | ||
2015-10-27 16:03 | hgbot | Resolution | open => fixed | ||
2015-10-27 16:03 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5f300c6e16595af756e66bc3eb88d89d737c2d08 [^] | ||
2015-10-28 16:06 | marvintm | Status | resolved => closed | ||
2015-10-28 16:06 | marvintm | Fixed in Version | => RR16Q1 |
Notes | |||||
|
|||||
|
|