Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037836Retail ModulesWeb POSpublic2018-02-05 16:102018-03-19 13:21
inaki_garcia 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
main 
RR18Q2 
guilleaer
No
0037836: [RR18Q1] [Stock Validation] [Support for Attributes] Error when adding a product with attributes to a receipt causes POS failure
Adding a product with an Attribute Set that has more than one attribute to the receipt returns a parsing error of the
attribute value inputted in the "Attribute Set Value" popup, no matter whether the value is correct or not. This issue
is reproducible when Enable Stock Validation ("Web POS stock validation" module) and Support for Attributes
preferences are enabled and causes complete failure of the Web POS (the parsing error is repeatedly shown for any
action attempted and the UI can completely freeze).

The setup to reproduce this issue (unless it were a misconfiguration issue) is detailed in Steps to Reproduce section.
PRECONDITIONS:
- "Web POS stock validation" module must be installed
- Support for Attributes preference must be activated
- The subject product and attributes to reproduced this issue were configured as follows:
* Product:
  * Search Key: NTP
  * Name: New Test Product
  * Product Category: Backpacks & Travel
  * Records in "Price" tab: "The White Valley Group Purchase Price List Version" and
    "The White Valley Group Sale Price list (Opening Store)"
  * Attribute Set: NTP Attributes
* Attribute Set (NTP Attributes):
  * Require At Least One Value and Active checkboxes: checked | Rest of the checkboxes unchecked
  * In "Assigned Attributes" tab: Attribute 1, Attribute 2
* "Attribute Value"s for "Attribute 1":
  * Search Key: "PS-ASB" | Name: "VAL1"
  * Search Key: "PS-ASC" | Name: "VAL2"
* "Attribute Value"s for "Attribute 2":
  * Search Key: "PS-BSB" | Name: "VAL3"
  * Search Key: "PS-BSC" | Name: "VAL4"
- Add the product to the Assortment of the subject store
- Ensure that there's enough stock for the product. To do so, Purchase Order, Good Receipt and Purchase Invoice were made for the Posets organization an store with the product's attribute set value set as "VAL1_VAL3".

0. Log in the Web POS' "PS-1" terminal as "posets" user
1. Click on the "Browse" button and hit the "Backpack & Travel" button
2. Select the "New Test Product" product. "Attribute Set Value" popup will be shown
3. Enter "VAL1_VAL3" value.

NOTICE that, in spite of having entered the correct attribute set value for the product available in stock, error
popups are shown which are JSON malformatting and field parsing related, as well as the related Javascript errors:

TypeError: callback is not a function
    at OB.DS.HWServer._print (8863469d9c6db472fbebd79379158bdf.js:1746)
    at OB.DS.HWServer.print (8863469d9c6db472fbebd79379158bdf.js:1745)
    at 8863469d9c6db472fbebd79379158bdf.js:1745
    at OB.DS.HWResource.getData (8863469d9c6db472fbebd79379158bdf.js:1736)
    at OB.DS.HWServer.print (8863469d9c6db472fbebd79379158bdf.js:1745)
    at PrintReceiptLine.print (8863469d9c6db472fbebd79379158bdf.js:2435)
    at G.d.trigger (backbone-0.9.2.min.js:9)
    at G.d.change (backbone-0.9.2.min.js:15)
    at G.d.set (backbone-0.9.2.min.js:12)
    at openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:3340:781; line: Object.OB.UTIL.showError (8863469d9c6db472fbebd79379158bdf.js:641) (*,+)

8863469d9c6db472fbebd79379158bdf.js:163 TypeError: Cannot read property 'toString' of undefined
    at toBigDecimal (8863469d9c6db472fbebd79379158bdf.js:663)
    at Object.OB.DEC.toBigDecimal (8863469d9c6db472fbebd79379158bdf.js:663)
    at G.d.printQty (8863469d9c6db472fbebd79379158bdf.js:1291)
    at Object.initComponents (8863469d9c6db472fbebd79379158bdf.js:2011)
    at Object.create (enyo.js:531)
    at Object.enyo.kind.inherited (enyo.js:410)
    at Object.create (enyo.js:690)
    at Object.enyo.kind.inherited (enyo.js:410)
    at Object.create (enyo.js:1313)
    at Object.enyo.kind.inherited (enyo.js:410); line: Object.OB.UTIL.showError (http://q [^]

-- Trying to delete the receipt shows the following error:
8863469d9c6db472fbebd79379158bdf.js:663 Uncaught TypeError: Cannot read property 'toString' of null
    at toBigDecimal (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:663:1024)
    at Object.OB.DEC.sub (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:663:1716)
    at G.d.<anonymous> (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:1302:427)
    at Array.forEach (<anonymous>)
    at Function.b.each.b.forEach (openbravo/web/org.openbravo.mobile.core/lib/vendor/underscore-1.3.3.min.js:11:39)
    at G.d.r.(anonymous function) [as each] (openbravo/web/org.openbravo.mobile.core/lib/vendor/backbone-0.9.2.min.js:25:314)
    at G.d.adjustPrices (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:1301:291)
    at G.d.prepareToSend (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:1301:175)
    at finishRemoveOrder (openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:1598:186)
    at openbravo/web/js/gen/8863469d9c6db472fbebd79379158bdf.js:1601:125
No tags attached.
png error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active.png (144,257) 2018-02-06 13:37
https://issues.openbravo.com/file_download.php?file_id=11550&type=bug
png

png error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-2.png (60,709) 2018-02-06 13:38
https://issues.openbravo.com/file_download.php?file_id=11551&type=bug
png

png error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-3-onLogout.png (252,870) 2018-02-06 13:38
https://issues.openbravo.com/file_download.php?file_id=11552&type=bug
png
Issue History
2018-02-05 16:10inaki_garciaNew Issue
2018-02-05 16:10inaki_garciaAssigned To => Retail
2018-02-05 16:10inaki_garciaTriggers an Emergency Pack => No
2018-02-05 16:30inaki_garciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16630#r16630
2018-02-05 16:42inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active.png
2018-02-05 16:42inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-2.png
2018-02-05 16:43inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-3-onLogout.png
2018-02-06 13:32inaki_garciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16637#r16637
2018-02-06 13:33inaki_garciaFile Deleted: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active.png
2018-02-06 13:33inaki_garciaFile Deleted: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-3-onLogout.png
2018-02-06 13:33inaki_garciaFile Deleted: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-2.png
2018-02-06 13:37inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active.png
2018-02-06 13:38inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-2.png
2018-02-06 13:38inaki_garciaFile Added: error-when-adding-a-product-with-attributes-with-enable-stock-validation-preference-active-3-onLogout.png
2018-02-07 13:20marvintmSeveritycritical => major
2018-02-08 13:36ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-02-08 13:36ranjith_qualiantech_comStatusnew => scheduled
2018-02-20 12:28hgbotCheckin
2018-02-20 12:28hgbotNote Added: 0102522
2018-02-21 08:12hgbotCheckin
2018-02-21 08:12hgbotNote Added: 0102540
2018-02-21 10:17ranjith_qualiantech_comStatusscheduled => resolved
2018-02-21 10:17ranjith_qualiantech_comResolutionopen => fixed
2018-03-19 13:21guilleaerReview Assigned To => guilleaer
2018-03-19 13:21guilleaerStatusresolved => closed
2018-03-19 13:21guilleaerFixed in Version => RR18Q2

Notes
(0102522)
hgbot   
2018-02-20 12:28   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 931cfbc7f10280a92452b34420837d75fa493ed5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Feb 20 16:58:14 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/931cfbc7f10280a92452b34420837d75fa493ed5 [^]

Related to issue 37836 : Validate Attribute Set Description with Attributes

* if attributes if not matched with product in backoffice, product should not be added and error should be shown
* Added AdMessage for existing errors

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/retail/posterminal/utility/AttributesUtils.java
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0102540)
hgbot   
2018-02-21 08:12   
Repository: erp/pmods/org.openbravo.retail.stockvalidation
Changeset: 5068afacf9b2ff7402e46d1e09f611caa54b714d
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Feb 21 12:42:37 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.stockvalidation/rev/5068afacf9b2ff7402e46d1e09f611caa54b714d [^]

Related to issue 37836 : Line should be removed if any exception occured in stock checker

* When line is changed, if qty is less than or zero then StockChecker should not be executed

---
M web/org.openbravo.retail.stockvalidation/js/modals.js
---