Openbravo Issue Tracking System - Retail Modules
View Issue Details
0030849Retail ModulesWeb POSpublic2015-09-16 21:232015-09-23 08:57
Orekaria 
Orekaria 
normalminorN/A
closedfixed 
5
 
RR15Q4 
mtaal
No
0030849: Add a method to extract a diff of 2 json objects
Add a method to extract a diff of 2 json objects
NA
No tags attached.
blocks feature request 0030850 closed Orekaria Improve the output of the error when the receipt has been changed during the closing process 
diff proposed-changes.diff (2,093) 2015-09-21 13:31
https://issues.openbravo.com/file_download.php?file_id=8462&type=bug
Issue History
2015-09-16 21:23OrekariaNew Issue
2015-09-16 21:23OrekariaAssigned To => Orekaria
2015-09-16 21:23OrekariaTriggers an Emergency Pack => No
2015-09-16 21:24hgbotCheckin
2015-09-16 21:24hgbotNote Added: 0080444
2015-09-16 21:24hgbotStatusnew => resolved
2015-09-16 21:24hgbotResolutionopen => fixed
2015-09-16 21:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f75b2fd01b8ea7a26c2c64c3a3f1866e176b40f9 [^]
2015-09-16 22:27hgbotCheckin
2015-09-16 22:27hgbotNote Added: 0080445
2015-09-18 11:21mtaalReview Assigned To => mtaal
2015-09-19 11:30OrekariaRelationship addedblocks 0030850
2015-09-21 13:29mtaalNote Added: 0080530
2015-09-21 13:29mtaalStatusresolved => new
2015-09-21 13:29mtaalResolutionfixed => open
2015-09-21 13:31mtaalFile Added: proposed-changes.diff
2015-09-22 09:38hgbotCheckin
2015-09-22 09:38hgbotNote Added: 0080551
2015-09-22 09:38hgbotCheckin
2015-09-22 09:38hgbotNote Added: 0080552
2015-09-22 09:38hgbotStatusnew => resolved
2015-09-22 09:38hgbotResolutionopen => fixed
2015-09-22 09:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f75b2fd01b8ea7a26c2c64c3a3f1866e176b40f9 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f73f91c60caafa90b6968a1f6f8cf512f8e79ec8 [^]
2015-09-23 08:57mtaalNote Added: 0080568
2015-09-23 08:57mtaalStatusresolved => closed
2015-09-23 08:57mtaalFixed in Version => RR15Q4

Notes
(0080444)
hgbot   
2015-09-16 21:24   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f75b2fd01b8ea7a26c2c64c3a3f1866e176b40f9
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Fri Sep 11 22:48:39 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f75b2fd01b8ea7a26c2c64c3a3f1866e176b40f9 [^]

Fixes issue 30849: add the 'OB.UTIL.diffJson' function

- Returns a JSON object with the difference between the provided JSONs
- Experimental. Do not be use for retail operations

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0080445)
hgbot   
2015-09-16 22:27   
Repository: tools/automation/pi-mobile
Changeset: 18cea99d33f6419be3442092fca2899b1f67a5ec
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Wed Sep 16 22:26:20 2015 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/18cea99d33f6419be3442092fca2899b1f67a5ec [^]

Verifies issue 30849: Add the 'I30849_VerifyDiffJSON' test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I30849_VerifyDiffJSON.java
---
(0080530)
mtaal   
2015-09-21 13:29   
I found several issues with the code, the following examples return an incorrect no-diff result imho:
OB.UTIL.diffJson(['a'], ['a', 'c'])
OB.UTIL.diffJson({'a': {'b': true}}, {'a': {}})
OB.UTIL.diffJson({'a': 3}, {'a': 3, 'c': 5})

Other comments:
[13:05:26] Martin Taal: if (obj2[key].constructor && obj2[key].constructor === Array && obj1[key].constructor && obj1[key] === Array && obj2[key].length !== 0) {
[13:05:46] Martin Taal: instead of obj1[key] === Array shouldn't be: obj1[key].constructor === Array

I have attached a diff which I think solve the issues I mention above.
(0080551)
hgbot   
2015-09-22 09:38   
Repository: tools/automation/pi-mobile
Changeset: 69820c201afbd7a65fc94ebb109c85427a84430e
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Mon Sep 21 19:48:05 2015 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/69820c201afbd7a65fc94ebb109c85427a84430e [^]

Verifies issue 30849: Updated 'I30849_VerifyDiffJSON' test

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I30849_VerifyDiffJSON.java
---
(0080552)
hgbot   
2015-09-22 09:38   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f73f91c60caafa90b6968a1f6f8cf512f8e79ec8
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Mon Sep 21 19:46:36 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f73f91c60caafa90b6968a1f6f8cf512f8e79ec8 [^]

Fixes issue 30849: Improved diff algorithm

---
M web/org.openbravo.mobile.core/source/utils/ob-utilities.js
---
(0080568)
mtaal   
2015-09-23 08:57   
tested and reviewed