Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #50102 All Revisions ] Back to Issue ]
Summary 0050102: Enable different user actions for ProductButton in keymaps depending on product properties
Revision 2022-08-30 08:37 by AugustoMauch
Description 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 [^]
Revision 2022-08-30 00:23 by AugustoMauch
Description 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 instances, 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 [^]
Revision 2022-08-30 00:20 by AugustoMauch
Description 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 instances, 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].

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Ticket/TicketLines/TicketLineComponentRegistry.js [^]


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker