Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039551Retail ModulesWeb POSpublic2018-10-26 13:432018-12-17 09:28
inaki_garcia 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
main 
RR19Q1 
marvintm
No
0039551: [RR18Q4] [Products OTF] Creating a product OTF from a product which has an Item Declaration causes error
Trying to create an "on the fly" product from a product which requires extra Contact Info / Item Declaration being added ends in failure: product isn't
created and a the following JS error is thrown.

TypeError: Cannot read property 'rfid' of undefined
    at askForContactInfo (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:3494:340)
    at .../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:3497:102
    at G.d.callbackExecutor (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:727:118)
    at .../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:3489:21
    at G.d.callbackExecutor (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:727:118)
    at G.d.executeHooks (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:727:6)
    at Object.addProductToOrder (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:2645:110)
    at Object.dispatch (.../web/org.openbravo.mobile.core/build/enyo.js:628:17)
    at Object.dispatchEvent (.../web/org.openbravo.mobile.core/build/enyo.js:612:30)
    at Object.enyo.kind.inherited (.../web/org.openbravo.mobile.core/build/enyo.js:410:28); line: Object.OB.UTIL.showError (.../web/js/gen/9f6e9494b1f6d3e39411ff99adc2e46c.js:702:4) (*,+)
 
 [Human Action Log]:
    1.- [11:00:58.662] 'centralmountains' in context: 'ndow_login_loginUserContainer_userButton'
    2.- [11:00:59.201] 'password' in context: 'terminal_containerWindow_login_password'
    3.- [11:01:00.658] 'Log In' in context: 'rminal_containerWindow_login_loginButton'
    4.- [11:01:11.597] Key pressed: Control
    5.- [11:01:11.604] Key pressed: Alt
    6.- [11:01:55.727] 'BROWSE' in context: 'lbar_button2_theButton_toolbarBtnCatalog'
    7.- [11:01:56.927] 'Avalanche transceiver150.50Price: 100€ - 200€, Use: High Mountaineering & Expeditions, Ski Touring, Range: 40m, Battery Life: 250h max, Object: Avalanche Safety' in context: 'productTable_tbody_control_renderProduct'
    8.- [11:01:57.702] 'Create OTF' in context: 'ductContextMenu_menu_listContextMenuItem'
    9.- [11:01:58.889] 'OK' in context: 'opup_bodyButtons_confirmationPopup_btnOk'
    10.- [11:01:59.570] 'mainMenuButton' in context: 'older_mainMenu_menuHolder_mainMenuButton'
    11.- [11:02:04.267] 'Layaway this Receipt' in context: '_menuHolder_menuScroller_menuLayaway_lbl'
    12.- [11:02:06.106] 'Avalanche transceiver150.50Price: 100€ - 200€, Use: High Mountaineering & Expeditions, Ski Touring, Range: 40m, Battery Life: 250h max, Object: Avalanche Safety' in context: 'roductTable_tbody_control_renderProduct2'
    13.- [11:02:06.657] 'Create OTF' in context: 'ductContextMenu_menu_listContextMenuItem'
    14.- [11:02:08.473] 'Apply' in context: 'ProductDuplicate_bodyButtons_btnApplyOTF'

processConsoleLevel @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:195
OB.error @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:196
OB.UTIL.showError @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:702
window.onerror @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:1361
error (async)
(anonymous) @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:1359
(anonymous) @ 9f6e9494b1f6d3e39411ff99adc2e46c.js:1361
9f6e9494b1f6d3e39411ff99adc2e46c.js:3494 Uncaught TypeError: Cannot read property 'rfid' of undefined
    at askForContactInfo (9f6e9494b1f6d3e39411ff99adc2e46c.js:3494)
    at 9f6e9494b1f6d3e39411ff99adc2e46c.js:3497
    at G.d.callbackExecutor (9f6e9494b1f6d3e39411ff99adc2e46c.js:727)
    at 9f6e9494b1f6d3e39411ff99adc2e46c.js:3489
    at G.d.callbackExecutor (9f6e9494b1f6d3e39411ff99adc2e46c.js:727)
    at G.d.executeHooks (9f6e9494b1f6d3e39411ff99adc2e46c.js:727)
    at Object.addProductToOrder (9f6e9494b1f6d3e39411ff99adc2e46c.js:2645)
    at Object.dispatch (enyo.js:628)
    at Object.dispatchEvent (enyo.js:612)
    at Object.enyo.kind.inherited (enyo.js:410)
PRECONDITIONS:
(1) "Contact customer info for product" module and its "WEB POS Show BusinessPartner Birth Information" preference need to be installed and configured, respectively.
(2) "Products on fly" module and the following preferences:
    - Enable creation OTF product from Main Menu
    - Enable creation OTF product from Context Menu
    - Enable OTF Only in laid away receipt and Quotations
    - Uncheck IsStocked Flag in OTF
    need to be installed and activated, respectively.

For more info, check their wiki pages:
(1) http://wiki.openbravo.com/wiki/Projects:Contact_Info_For_Product_in_WebPOS/User_Guide [^]
(2) http://wiki.openbravo.com/wiki/Projects:Product_On_The_Fly_in_WebPOS/User_Guide [^]

0. Log in to the Web POS as "vallblanca"
1. Search for product "Basecamp lantern" (product already configured to add extra Contact Info / Item Declaration) using either "BROWSE" or "SEARCH" tabs
2. Click on the contextual button (3 vertical dots) and click on the displayed option "Create OTF"
3. Check that all the required fields are filled and click on "Apply"
4. NOTICE that the product isn't created and that the following JS error of the description is shown

No tags attached.
Issue History
2018-10-26 13:43inaki_garciaNew Issue
2018-10-26 13:43inaki_garciaAssigned To => Retail
2018-10-26 13:43inaki_garciaTriggers an Emergency Pack => No
2018-10-26 13:54inaki_garciaIssue cloned0039552
2018-10-29 11:03inaki_garciaDescription Updatedbug_revision_view_page.php?rev_id=17874#r17874
2018-10-29 11:03inaki_garciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17876#r17876
2018-10-29 11:06inaki_garciaDescription Updatedbug_revision_view_page.php?rev_id=17877#r17877
2018-11-19 13:53ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-11-19 13:53ranjith_qualiantech_comStatusnew => scheduled
2018-11-20 08:23hgbotCheckin
2018-11-20 08:23hgbotNote Added: 0107999
2018-11-20 08:23hgbotStatusscheduled => resolved
2018-11-20 08:23hgbotResolutionopen => fixed
2018-11-20 08:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.contactinfoforproduct/rev/cfc5d51289760121620661eaed154bbed0ea08ec [^]
2018-12-17 09:28marvintmReview Assigned To => marvintm
2018-12-17 09:28marvintmStatusresolved => closed
2018-12-17 09:28marvintmFixed in Version => RR19Q1

Notes
(0107999)
hgbot   
2018-11-20 08:23   
Repository: erp/pmods/org.openbravo.retail.contactinfoforproduct
Changeset: cfc5d51289760121620661eaed154bbed0ea08ec
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Nov 20 12:53:21 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.contactinfoforproduct/rev/cfc5d51289760121620661eaed154bbed0ea08ec [^]

Fixed issue 39551 : Validated hook arguments before showing Item declaration popup

* In PreAddProductToOrder hook, args options and attrs will be undefined in few cases. So it should be defined

---
M web/org.openbravo.retail.contactinfoforproduct/js/hookPreAddProductToOrder.js
---