Openbravo Issue Tracking System - POS2
View Issue Details
0050102POS2POSpublic2022-08-30 00:202022-09-06 00:20
AugustoMauch 
gonzalo_fernandez 
normalmajorhave not tried
closedfixed 
5
 
22Q4 
No
0050102: Enable different user actions for ProductButton in keymaps depending on product properties
The ProductKeymap component renders instances of ProductButton. It does not include a leftAction property so the default one (OBPOS2_AddProduct) is always used.

It would be useful if different leftActions could be selected based on the product properties. For instance, products that represent generic products (its isGeneric flag is true), would execute an action that would not add the product to the ticket but instead show in the search dialog all its product variants (i.e. OBPOS2_SearchVariantProducts action).

In this feature only the infrastructure to register and get the leftAction based on the product properties will be provided. The implementation could be very similar to the one used to determine the component to render ticket lines [1]. This [2] could be a good point to set the leftAction property of a product if it matches any of those registered in the new register.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Ticket/TicketLines/TicketLineComponentRegistry.js [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/ProductKeymap/GetProductKeymapInfo.js#L70 [^]
-
No tags attached.
Issue History
2022-08-30 00:20AugustoMauchNew Issue
2022-08-30 00:20AugustoMauchAssigned To => gonzalo_fernandez
2022-08-30 00:20AugustoMauchTriggers an Emergency Pack => No
2022-08-30 00:23AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=24688#r24688
2022-08-30 00:23AugustoMauchSeverityminor => major
2022-08-30 08:28AugustoMauchStatusnew => scheduled
2022-08-30 08:37AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=24689#r24689
2022-08-31 13:40hgbotNote Added: 0140564
2022-09-06 00:20hgbotResolutionopen => fixed
2022-09-06 00:20hgbotStatusscheduled => closed
2022-09-06 00:20hgbotFixed in Version => 22Q4
2022-09-06 00:20hgbotNote Added: 0140726
2022-09-06 00:20hgbotNote Added: 0140727

Notes
(0140564)
hgbot   
2022-08-31 13:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1173 [^]
(0140726)
hgbot   
2022-09-06 00:20   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 4afb4a87afbfbb48dc1c57b0bed6d3b6110371a0
Author: Gonzalo Fernández García <gonzalo.fernandez@openbravo.com>
Date: 06-09-2022 00:08:21
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/4afb4a87afbfbb48dc1c57b0bed6d3b6110371a0 [^]

Fixes ISSUE-50102: Support different leftActions according to product properties

With this change, ProductButtons with specific properties can execute a different action rather than the default AddProduct one

---
A web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductButtonActionRegistry.js
A web-jspack/org.openbravo.pos2/src/components/ProductButton/__test__/ProductButtonActionRegistry.test.js
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductButton.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductButton/__test__/ProductButton.test.jsx
---
(0140727)
hgbot   
2022-09-06 00:20   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1173 [^]