Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041268Retail ModulesWeb POSpublic2019-07-01 09:582019-08-06 16:12
aaroncalero 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR19Q2.2RR19Q2.2 
marvintm
No
0041268: OB.UTIL.clone always copies arrays by reference
OB.UTIL.clone always copies arrays by reference, instead of generating a new array and cloning the values.
Check the code that copies array properties:
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/web/org.openbravo.mobile.core/source/utils/ob-utilities.js#l1057 [^]

Instead of checking if the property is an array, the code is checking if the whole object is an array, which is wrong
In the linked code, change from
} else if (_.isArray(source)) {
to
} else if (_.isArray(source.get(key))) {
No tags attached.
blocks defect 0041207 closed ranjith_qualiantech_com OB.UTIL.clone always copies arrays by reference 
Issue History
2019-07-03 19:04marvintmTypedefect => backport
2019-07-03 19:04marvintmTarget Version => RR19Q2.2
2019-07-22 12:07hgbotCheckin
2019-07-22 12:07hgbotNote Added: 0113558
2019-07-22 12:08hgbotCheckin
2019-07-22 12:08hgbotNote Added: 0113559
2019-07-22 12:09ranjith_qualiantech_comStatusscheduled => resolved
2019-07-22 12:09ranjith_qualiantech_comResolutionopen => fixed
2019-08-06 16:12marvintmReview Assigned To => marvintm
2019-08-06 16:12marvintmStatusresolved => closed
2019-08-06 16:12marvintmFixed in Version => RR19Q2.2

Notes
(0113558)
hgbot   
2019-07-22 12:07   
Repository: retail/backports/3.0RR19Q2.2/org.openbravo.retail.posterminal
Changeset: 3890477c3f2cabb3c889c814b0fa5e361e8dd843
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jul 22 15:36:26 2019 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR19Q2.2/org.openbravo.retail.posterminal/rev/3890477c3f2cabb3c889c814b0fa5e361e8dd843 [^]

Related to issue 41268 : Shipping Address should be same as invoice address when loading paid receipt

* When splitting lines with promotions, line lineQtyOffer should be updated instead of creating new lines to apply promotions

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0113559)
hgbot   
2019-07-22 12:08   
Repository: retail/backports/3.0RR19Q2.2/org.openbravo.mobile.core
Changeset: f9e72aad8cd3304fe8823775c85093867fc384f5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jul 22 15:36:28 2019 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR19Q2.2/org.openbravo.mobile.core/rev/f9e72aad8cd3304fe8823775c85093867fc384f5 [^]

Related to issue 41268 : Update OB.UTIL.clone to check the property is an Array

* When cloning object from array, if object is backbone the it should cloned recursively
  if object is not backbone, then copy of object should be pushed to target object

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---