Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040995Retail ModulesWeb POSpublic2019-05-31 15:042019-08-06 16:28
aaroncalero 
rqueralta 
highmajoralways
closedfixed 
5
 
RR19Q4 
marvintm
No
0040995: BPLocation called without filters under specific circumstances
When using the Remote for Customers preference enabled, there is a specific flow in web pos that causes a call to BPLocation without filters, which causes it to return all available addresses, and potentially associating a customer with an address that is not their's.
Log in in Backend, go to the Preference window and configure the Enable Remote for Customer preference with value Y

Login in Web POS
Click on the Customer button and search for Arturo Montoro
Click on the 3 dots context menu and click on Edit Customer
Save the customer and assign it to the receipt.
Verify the locationModel and locationBillModel attributes of the customer:
OB.MobileApp.model.receipt.get('bp').get('locationModel') and OB.MobileApp.model.receipt.get('bp').get('locationBillModel')

The locationModel will match the address of the receipt, but the locationBillModel will be an address from a different customer.
The problem seems to be in the setBPandBPLoc function of the order.
With the specified flow, it seems that the locId property is missing in the customer model.
No tags attached.
Issue History
2019-05-31 15:04aaroncaleroNew Issue
2019-05-31 15:04aaroncaleroAssigned To => Retail
2019-05-31 15:04aaroncaleroResolution time => 1560117600
2019-05-31 15:04aaroncaleroTriggers an Emergency Pack => No
2019-06-03 14:54rqueraltaAssigned ToRetail => rqueralta
2019-06-03 14:54rqueraltaStatusnew => scheduled
2019-06-05 15:22hgbotCheckin
2019-06-05 15:22hgbotNote Added: 0112424
2019-06-05 15:22hgbotStatusscheduled => resolved
2019-06-05 15:22hgbotResolutionopen => fixed
2019-06-05 15:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1d39d9737c4fc16d1e497b7171f16a2f6915216e [^]
2019-06-06 18:43marvintmReview Assigned To => marvintm
2019-06-06 18:43marvintmStatusresolved => closed
2019-06-06 18:43marvintmFixed in Version => RR19Q3
2019-06-10 16:07hgbotCheckin
2019-06-10 16:07hgbotNote Added: 0112544
2019-07-12 13:10aaroncaleroNote Added: 0113332
2019-07-12 13:10aaroncaleroStatusclosed => new
2019-07-12 13:10aaroncaleroResolutionfixed => open
2019-07-12 13:10aaroncaleroFixed in VersionRR19Q3 =>
2019-07-18 04:42hgbotCheckin
2019-07-18 04:42hgbotNote Added: 0113487
2019-07-18 04:42hgbotStatusnew => resolved
2019-07-18 04:42hgbotResolutionopen => fixed
2019-07-18 04:42hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1d39d9737c4fc16d1e497b7171f16a2f6915216e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cc851a790e6811ed7ed76f93a2ddff87a7230a73 [^]
2019-07-22 17:46guilleaerReview Assigned Tomarvintm => guilleaer
2019-07-22 17:46guilleaerStatusresolved => closed
2019-07-22 17:46guilleaerFixed in Version => RR19Q4
2019-07-25 10:11aaroncaleroNote Added: 0113645
2019-07-25 10:11aaroncaleroStatusclosed => new
2019-07-25 10:11aaroncaleroResolutionfixed => open
2019-07-25 10:11aaroncaleroFixed in VersionRR19Q4 =>
2019-08-04 05:15hgbotCheckin
2019-08-04 05:15hgbotNote Added: 0113802
2019-08-04 05:15hgbotStatusnew => resolved
2019-08-04 05:15hgbotResolutionopen => fixed
2019-08-04 05:15hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cc851a790e6811ed7ed76f93a2ddff87a7230a73 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/90fa52f23e8a5d876e29ff3e97cae6ca0fe2749a [^]
2019-08-06 16:28marvintmReview Assigned Toguilleaer => marvintm
2019-08-06 16:28marvintmStatusresolved => closed
2019-08-06 16:28marvintmFixed in Version => RR19Q4

Notes
(0112424)
hgbot   
2019-06-05 15:22   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1d39d9737c4fc16d1e497b7171f16a2f6915216e
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Jun 04 13:38:22 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1d39d9737c4fc16d1e497b7171f16a2f6915216e [^]

Fixed issue 40995: BPLocation called without filters under specific circumstances

- Updated locationBillModel object with the billing address value

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0112544)
hgbot   
2019-06-10 16:07   
Repository: tools/automation/pi-mobile
Changeset: 356e6ae4b8b0f9945695d7b6874ca983dda6cf11
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Wed Jun 05 11:31:28 2019 -0400
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/356e6ae4b8b0f9945695d7b6874ca983dda6cf11 [^]

Related to issue 40995: added automated test

---
M src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customer/I40995_VerifyBPLocationModelMatchCustomerAddress.java
---
(0113332)
aaroncalero   
2019-07-12 13:10   
The issue is not fixed yet:
1. The query with the wrong/missing filters is still executed. There is even a warning in the browser console:
f4a182c98b49c251c603c54cb07af3cf.js:185 [dberror] OB.Dal.get: id not found.

2. If the customer has 2 different addresses (one for shipping and one for invoicing), the customer model that is set on the tickets ends up having the same address on both the shipping and invoicing addresses (locationModel and locationBillModel). This does not happen when the customer is assigned directly from the selector.
(0113487)
hgbot   
2019-07-18 04:42   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: cc851a790e6811ed7ed76f93a2ddff87a7230a73
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Jul 16 23:31:59 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/cc851a790e6811ed7ed76f93a2ddff87a7230a73 [^]

Fixed issue 40995: BPLocation called without filters under specific circumstances

- Updated locationModel object if shipping address is not undefined

---
M web/org.openbravo.retail.posterminal/js/model/businesspartner.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0113645)
aaroncalero   
2019-07-25 10:11   
The issue is not fixed yet. The main problem is still there:
The query with the missing filters is still executed. There is even a warning in the browser console:
f4a182c98b49c251c603c54cb07af3cf.js:185 [dberror] OB.Dal.get: id not found.

In an environment with big data (i.e. 200k customers) this query might try to retrieve 200k+ addresses.

When checking the problem, remember to configure the Enable Remote for Customer preference with value Y.
(0113802)
hgbot   
2019-08-04 05:15   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 90fa52f23e8a5d876e29ff3e97cae6ca0fe2749a
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Wed Jul 31 17:42:34 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/90fa52f23e8a5d876e29ff3e97cae6ca0fe2749a [^]

Fixed issue 40995: BPLocation called without filters under specific circumstances

- Updated locId value in customer object

---
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
---