diff --git a/__manifest__.py b/__manifest__.py index d6622b1..721ee43 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -18,17 +18,18 @@ 'installable': True, 'assets': { 'web.assets_backend': [ - 'static/src/css/category_color.css', + 'open_workshop/static/src/css/category_color.css', ], 'point_of_sale._assets_pos': [ - - 'open_workshop/static/src/js/product_screen_template_patch.js', 'open_workshop/static/src/css/pos.css', - 'open_workshop/static/src/js/ows_pos_customer_sidebar.js', - 'open_workshop/static/src/xml/ows_pos_customer_sidebar.xml', 'open_workshop/static/src/js/ows_machine_access_list.js', + 'open_workshop/static/src/js/ows_pos_customer_sidebar.js', + 'open_workshop/static/src/js/ows_pos_sidebar.js', + 'open_workshop/static/src/js/ows_product_screen_template_patch.js', 'open_workshop/static/src/xml/ows_machine_access_list.xml', - 'open_workshop/static/src/xml/ows_product_screen.xml', + 'open_workshop/static/src/xml/ows_pos_customer_sidebar.xml', + 'open_workshop/static/src/xml/ows_pos_sidebar.xml', + 'open_workshop/static/src/xml/ows_product_screen_template_patch.xml', ], }, 'description': """ diff --git a/static/src/js/ows_machine_access_list.js b/static/src/js/ows_machine_access_list.js index 40eb6ee..4f84de3 100644 --- a/static/src/js/ows_machine_access_list.js +++ b/static/src/js/ows_machine_access_list.js @@ -1,9 +1,10 @@ -// @odoo-module +// @odoo-module ows_machine_access_list.js import { Component, useState } from "@odoo/owl"; import { useBus } from "@web/core/utils/hooks"; import { usePos } from "@point_of_sale/app/store/pos_hook"; import { rpc } from "@web/core/network/rpc"; +import { registry } from "@web/core/registry"; export class OwsMachineAccessList extends Component { static template = 'open_workshop.OwsMachineAccessList'; @@ -65,3 +66,9 @@ export class OwsMachineAccessList extends Component { } } + + + + +registry.category("templates").add("open_workshop.OwsMachineAccessList", OwsMachineAccessList); + diff --git a/static/src/js/ows_pos_customer_sidebar.js b/static/src/js/ows_pos_customer_sidebar.js index 2b11d4d..613f9ac 100644 --- a/static/src/js/ows_pos_customer_sidebar.js +++ b/static/src/js/ows_pos_customer_sidebar.js @@ -1,7 +1,8 @@ -// @odoo-module +// @odoo-module ows_pos_customer_sidebar.js import { Component } from "@odoo/owl"; import { useService } from "@web/core/utils/hooks"; +import { registry } from "@web/core/registry"; import { usePos } from "@point_of_sale/app/store/pos_hook"; import { _t } from "@web/core/l10n/translation"; import { ask } from "@web/core/confirmation_dialog/confirmation_dialog"; @@ -56,7 +57,8 @@ export class OwsPosCustomerSidebar extends Component { } getFilteredOrderList() { - return this.pos.get_order_list(); + //return this.pos.get_order_list(); + return this.pos.orders ? this.pos.orders.filter(order => order.get_partner()) : []; } getDate(order) { @@ -77,3 +79,5 @@ export class OwsPosCustomerSidebar extends Component { this.env.bus.trigger('partner-changed'); } } + + diff --git a/static/src/js/ows_pos_sidebar.js b/static/src/js/ows_pos_sidebar.js new file mode 100644 index 0000000..dfdc8e3 --- /dev/null +++ b/static/src/js/ows_pos_sidebar.js @@ -0,0 +1,11 @@ +// ows_pos_sidebar.js +// @odoo-module + +import { Component } from "@odoo/owl"; +import { OwsPosCustomerSidebar } from "./ows_pos_customer_sidebar"; +import { OwsMachineAccessList } from "./ows_machine_access_list"; + +export class OwsPosSidebar extends Component { + static template = "open_workshop.OwsPosSidebar"; + static components = { OwsPosCustomerSidebar, OwsMachineAccessList }; +} \ No newline at end of file diff --git a/static/src/js/ows_product_screen_template_patch.js b/static/src/js/ows_product_screen_template_patch.js new file mode 100644 index 0000000..29690f3 --- /dev/null +++ b/static/src/js/ows_product_screen_template_patch.js @@ -0,0 +1,15 @@ +// 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 { OwsPosSidebar } from "./ows_pos_sidebar"; + +class OwsProductScreen extends ProductScreen { + static components = Object.assign({}, ProductScreen.components, { + OwsPosSidebar, + }); +} + +registry.category("pos_screens").remove("ProductScreen"); +registry.category("pos_screens").add("ProductScreen", OwsProductScreen); diff --git a/static/src/js/product_screen_template_patch.js b/static/src/js/product_screen_template_patch.js deleted file mode 100644 index e3a979a..0000000 --- a/static/src/js/product_screen_template_patch.js +++ /dev/null @@ -1,25 +0,0 @@ -// @odoo-module - -import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; -import { registry } from "@web/core/registry"; -import { OwsPosCustomerSidebar } from "@open_workshop/js/ows_pos_customer_sidebar"; -import { OwsMachineAccessList } from "@open_workshop/js/ows_machine_access_list"; - -console.log("🔍 product_screen_template_patch.js wurde geladen"); - -export class OwsProductScreen extends ProductScreen { - static template = "open_workshop.ProductScreen"; - static components = { - ...ProductScreen.components, - OwsPosCustomerSidebar, - OwsMachineAccessList, - }; - - setup() { - super.setup(); // wichtig! - console.log("📦 OwsProductScreen aktiv, Template:", this.constructor.template); - } -} - -registry.category("pos_screens").remove("ProductScreen"); -registry.category("pos_screens").add("ProductScreen", OwsProductScreen); diff --git a/static/src/xml/ows_briefing_details.xml b/static/src/xml/ows_briefing_details.xml deleted file mode 100644 index 3f056b3..0000000 --- a/static/src/xml/ows_briefing_details.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -
-
- Address - - - - - - - N/A - -
-
- Email - - - - - - - N/A - -
- -
- Geburtstag - - - - - - - N/A - -
-
- Phone - - - - - - - N/A - -
-
- Pricelist - - - - - - - N/A - -
-
- Haftungsausschluss prüfen! -
-
- -
- - - -
diff --git a/static/src/xml/ows_briefing_details_edit.xml b/static/src/xml/ows_briefing_details_edit.xml deleted file mode 100644 index 53c79a6..0000000 --- a/static/src/xml/ows_briefing_details_edit.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -
-
- Street - -
-
- Postcode - -
-
- City - -
-
- Country - -
-
- Email - -
-
- Phone - -
-
- Geburtstag - -
-
- Pricelist - -
- -
- Haftungsauschschluß - -
-
-
- - -
diff --git a/static/src/xml/ows_pos_order_selector.xml b/static/src/xml/ows_pos_order_selector.xml deleted file mode 100644 index e4956b7..0000000 --- a/static/src/xml/ows_pos_order_selector.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - HOBBYHIMMEL - - - - - - - - - - - -
-
-
- - - -
-
- - - - - - -
- - - - - - - - - - - - - ? - - - - - - - - - - - - - - - ? - - - - - - -
-
- -
diff --git a/static/src/xml/ows_pos_sidebar.xml b/static/src/xml/ows_pos_sidebar.xml new file mode 100644 index 0000000..1777b19 --- /dev/null +++ b/static/src/xml/ows_pos_sidebar.xml @@ -0,0 +1,9 @@ + + + +
+ + +
+
+
\ No newline at end of file diff --git a/static/src/xml/ows_product_screen.xml b/static/src/xml/ows_product_screen.xml deleted file mode 100644 index 35fb953..0000000 --- a/static/src/xml/ows_product_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - -
- - -
-
- -
-
diff --git a/static/src/xml/ows_product_screen_template_patch.xml b/static/src/xml/ows_product_screen_template_patch.xml new file mode 100644 index 0000000..e243e82 --- /dev/null +++ b/static/src/xml/ows_product_screen_template_patch.xml @@ -0,0 +1,8 @@ + + + + + + + +