Openbravo Issue Tracking System - POS2
View Issue Details
0047342POS2POSpublic2021-07-06 12:472021-07-06 21:49
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
No
0047342: Error when logging in if Keymap Category contains unused Product Category
A keymap category can contain product categories, meaning that all the products that belong to those product categories will be included in the keymap category.

If a product category is added to a keymap category and that product category is not loaded on WebPOS (i.e. because no product in the assortment belongs to it), an error will be thrown when logging in:

Cannot destructure property 'obpos2Color' of 'n[e.productCategoryId]' as it is undefined
In any environment with pos2 sampledata (i.e. https://livebuilds.openbravo.com/retail_pos2_pgsql/ [^])

In the backoffice:
- Open POS Keymap
- Select Main App Keymap
- Select v1 version
- Select Ski Keymap Category
- In the Product Categories subtab, add Meters (a product category that will not be available on WebPOS)

In WebPOS:
- Log in. An error will be thrown:

Cannot destructure property 'obpos2Color' of 'n[e.productCategoryId]' as it is undefined
No tags attached.
Issue History
2021-07-06 12:47AugustoMauchNew Issue
2021-07-06 12:47AugustoMauchAssigned To => AugustoMauch
2021-07-06 12:47AugustoMauchTriggers an Emergency Pack => No
2021-07-06 12:53AugustoMauchStatusnew => scheduled
2021-07-06 13:03hgbotNote Added: 0130177
2021-07-06 21:49hgbotResolutionopen => fixed
2021-07-06 21:49hgbotStatusscheduled => closed
2021-07-06 21:49hgbotNote Added: 0130203
2021-07-06 21:49hgbotNote Added: 0130204

Notes
(0130177)
hgbot   
2021-07-06 13:03   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/596 [^]
(0130203)
hgbot   
2021-07-06 21:49   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: b0373e9ef60fbf3b9eb5596066fa3431854c07f8
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 2021-07-06T21:48:10+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/b0373e9ef60fbf3b9eb5596066fa3431854c07f8 [^]

Fixes ISSUE-47342: Error when referencing unused product category in keymap

Now when reading the keymap information, ifa product category is not found on WebPOS, it is ignored.

Some test data has been added to demonstrate when if an unknown product category is added no error is thrown

---
M web-jspack/org.openbravo.pos2/src/configurations/keymapConfiguration/__test__/mockMasterdataKeymapCategoryProductCategory.js
M web-jspack/org.openbravo.pos2/src/configurations/keymapConfiguration/getKeymapInformation.js
---
(0130204)
hgbot   
2021-07-06 21:49   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/596 [^]