Openbravo Issue Tracking System - POS2
View Issue Details
0047126POS2POSpublic2021-06-14 17:312021-06-23 09:47
jmelin 
prakashmurugesan88 
highmajoralways
closedinvalid 
30Openbravo Appliance 14.04
 
 
guilleaer
No
0047126: JIRA 2086 - Error when trying to remove a component from a menu
When creating an order, if we try to remove a component from a menu, then an error is triggerer:
* Cannot destructure property 'productId' of 'o[a.id][0]' as it is undefined.

The error was not reproductible on tap

1. Connect to POS
2. Create a sales order and add a menu with its component
3. Select the menu and one of the component
4. Click on the component name in the keymap to remove it
=> Error "Cannot destructure property 'productId' of 'o[a.id][0]' as it is undefined" is triggered
No tags attached.
Issue History
2021-06-14 17:31jmelinNew Issue
2021-06-14 17:31jmelinAssigned To => Retail
2021-06-14 17:31jmelinTriggers an Emergency Pack => No
2021-06-15 09:32dmiguelezResolution time => 1624917600
2021-06-15 09:33dmiguelezStatusnew => scheduled
2021-06-15 09:33dmiguelezStatusscheduled => acknowledged
2021-06-22 15:09prakashmurugesan88Assigned ToRetail => prakashmurugesan88
2021-06-22 15:09prakashmurugesan88Statusacknowledged => scheduled
2021-06-23 09:36guilleaerReview Assigned To => guilleaer
2021-06-23 09:36guilleaerNote Added: 0129733
2021-06-23 09:36guilleaerStatusscheduled => closed
2021-06-23 09:36guilleaerResolutionopen => invalid
2021-06-23 09:47prakashmurugesan88Note Added: 0129734

Notes
(0129733)
guilleaer   
2021-06-23 09:36   
Caused by custom code
(0129734)
prakashmurugesan88   
2021-06-23 09:47   
Error occurred in following line,
https://gitlab.com/obcustomers/AGAP/com.openbravo.flunch.reports/-/blob/devel/web-jspack/com.openbravo.flunch.reports/src/actions/Product.js#L27 [^]

Because there is no product present under the selectedCategory in selectedProductsByCategory array.

This is because product added to the category are already removed in ‘updateMenu prehook’, before calling this ‘updateMenu action preparation’,
https://gitlab.com/openbravo/devel/pmods/org.openbravo.pos2.restaurant/-/blob/master/web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/user-actions/AddProductToMenu.js#L31 [^]

https://gitlab.com/openbravo/devel/pmods/org.openbravo.pos2.restaurant/-/blob/master/web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/user-actions/AddProductToMenu.js#L83 [^]

I think updateMenu action preparation’ should be moved to ‘updateMenu prehook’
https://gitlab.com/obcustomers/AGAP/com.openbravo.flunch.reports/-/blob/devel/web-jspack/com.openbravo.flunch.reports/src/actions/Product.js#L23 [^]