Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028451Retail ModulesWeb POSpublic2014-12-18 16:472014-12-29 16:47
aaroncalero 
aaroncalero 
normalminorsometimes
closedfixed 
5
 
RR15Q1 
mtaal
No
0028451: If the apply button on the Receipt Discounts tab is tapped before the discounts combo is loaded, a javascript error is shown
If the apply button on the Receipt Discounts tab is tapped before the discounts combo is loaded, a javascript error is shown
These steps can be reproduced during automated tests
Create a ticket in Web POS
Open the menu, Receipt Discounts menu entry.
Click on the apply to all lines check.
Click on Apply.

If the discounts combo is not loaded yet, the following error is shown:
Uncaught TypeError: Cannot read property 'model' of undefined

Alternative steps to reproduce using the TestRegistry:
Create a new ticket.
Execute the following commands on the browser console in a single line:
TestRegistry.registry('menuHolder_mainMenuButton').enyoObject.waterfall('ontap');
TestRegistry.registry('menuScroller_menuDiscounts').enyoObject.waterfall('ontap');
TestRegistry.registry('discountsEdit_checkSelectAll').enyoObject.waterfall('ontap');
TestRegistry.registry('discountsEdit_btnApply').enyoObject.waterfall('ontap');

These commands will open the Receipt Discounts tab and apply the first discount to all lines.
When the Receipt discounts tab is shown, the discounts combo is reset. The Apply button should only be enabled after the discounts combo has finished reloading.
In order to ensure this:
The Apply button will be disabled right before resetting the discounts combo.
After the discounts combo is reloaded we will call ticketLineChecked with the current checked lines to enable the button if needed.
The ticketLineChecked function will have a check to enable the Apply button only if the discounts combo is enabled.
No tags attached.
Issue History
2014-12-18 16:47aaroncaleroNew Issue
2014-12-18 16:47aaroncaleroAssigned To => aaroncalero
2014-12-18 16:47aaroncaleroTriggers an Emergency Pack => No
2014-12-18 17:15hgbotCheckin
2014-12-18 17:15hgbotNote Added: 0072706
2014-12-18 17:16hgbotStatusnew => resolved
2014-12-18 17:16hgbotResolutionopen => fixed
2014-12-18 17:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/96fde12e1b53c1ed1103a988ce45dc5a1589d3cc [^]
2014-12-29 14:09mtaalNote Added: 0072851
2014-12-29 14:09mtaalStatusresolved => new
2014-12-29 14:09mtaalResolutionfixed => open
2014-12-29 16:38mtaalStatusnew => scheduled
2014-12-29 16:38mtaalNote Added: 0072855
2014-12-29 16:38mtaalfix_in_branch => pi
2014-12-29 16:45mtaalNote Added: 0072856
2014-12-29 16:45mtaalStatusscheduled => resolved
2014-12-29 16:45mtaalFixed in Version => RR15Q1
2014-12-29 16:45mtaalResolutionopen => fixed
2014-12-29 16:47mtaalNote Edited: 0072856bug_revision_view_page.php?bugnote_id=0072856#r7358
2014-12-29 16:47mtaalReview Assigned To => mtaal
2014-12-29 16:47mtaalNote Added: 0072857
2014-12-29 16:47mtaalStatusresolved => closed

Notes
(0072706)
hgbot   
2014-12-18 17:15   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 96fde12e1b53c1ed1103a988ce45dc5a1589d3cc
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Thu Dec 18 17:13:43 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/96fde12e1b53c1ed1103a988ce45dc5a1589d3cc [^]

Fixed issue 28451: If the apply button on the Receipt Discounts tab is tapped before the discounts combo is loaded, a javascript error is shown

---
M web/org.openbravo.retail.posterminal/js/pointofsale/view/ticketdiscount.js
---
(0072851)
mtaal   
2014-12-29 14:09   
Hi,
I can still reproduce the issue using the testregistry code. See the attached screenshot
the comp variable seems undefined.

gr. Martin
(0072855)
mtaal   
2014-12-29 16:38   
.
(0072856)
mtaal   
2014-12-29 16:45   
(edited on: 2014-12-29 16:47)
Re-opened for incorrect reason, setting back to resolved,

Remark by developer:

[15:34:48] Aarón Calero: I've reviewed the issue and the testregistry code fails because it ignores if buttons are disabled or not
[15:36:39] Aarón Calero: The error will never happen neither manually nor during a test (our test infrastructure checks if buttons are disabled before tapping them)

(0072857)
mtaal   
2014-12-29 16:47   
Tested and reviewed