diff --git a/open_workshop_pos/__manifest__.py b/open_workshop_pos/__manifest__.py index f2306b0..2fd0524 100644 --- a/open_workshop_pos/__manifest__.py +++ b/open_workshop_pos/__manifest__.py @@ -44,6 +44,7 @@ Autor: HobbyHimmel 'open_workshop_pos/static/src/xml/ows_pos_customer_sidebar.xml', 'open_workshop_pos/static/src/xml/ows_machine_access_list.xml', 'open_workshop_pos/static/src/xml/ows_product_screen_template_patch.xml', + 'open_workshop_pos/static/src/xml/ows_product_card_patch.xml', # CSS 'open_workshop_pos/static/src/css/pos.css', diff --git a/open_workshop_pos/static/src/js/ows_product_screen_template_patch.js b/open_workshop_pos/static/src/js/ows_product_screen_template_patch.js index 29690f3..d51f259 100644 --- a/open_workshop_pos/static/src/js/ows_product_screen_template_patch.js +++ b/open_workshop_pos/static/src/js/ows_product_screen_template_patch.js @@ -1,15 +1,14 @@ // product_screen_template_patch.js // @odoo-module -import { registry } from "@web/core/registry"; import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { patch } from "@web/core/utils/patch"; import { OwsPosSidebar } from "./ows_pos_sidebar"; -class OwsProductScreen extends ProductScreen { - static components = Object.assign({}, ProductScreen.components, { +// Patch the ProductScreen components to add the OwsPosSidebar +patch(ProductScreen, { + components: { + ...ProductScreen.components, OwsPosSidebar, - }); -} - -registry.category("pos_screens").remove("ProductScreen"); -registry.category("pos_screens").add("ProductScreen", OwsProductScreen); + }, +}); diff --git a/open_workshop_pos/static/src/xml/ows_product_card_patch.xml b/open_workshop_pos/static/src/xml/ows_product_card_patch.xml new file mode 100644 index 0000000..f4361eb --- /dev/null +++ b/open_workshop_pos/static/src/xml/ows_product_card_patch.xml @@ -0,0 +1,25 @@ + + + + + + + product-content d-flex flex-column px-2 justify-content-end rounded-bottom rounded-3 flex-shrink-1 + + + + + overflow-hidden lh-sm product-name mb-1 + + + + +
+ +
+
+ + + +
+