From af0481169a873646de3497c0e7d7041443f6bdae Mon Sep 17 00:00:00 2001 From: Martin Quinteros Date: Tue, 11 Jun 2024 16:22:27 -0300 Subject: [PATCH] [IMP] pos_event_sale: pre-commit execution --- pos_event_sale/__manifest__.py | 2 +- pos_event_sale/models/event_event.py | 5 ++--- pos_event_sale/models/pos_order.py | 4 ++-- pos_event_sale/static/src/js/Screens/PaymentScreen.js | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pos_event_sale/__manifest__.py b/pos_event_sale/__manifest__.py index 55271d0641..836607cad8 100644 --- a/pos_event_sale/__manifest__.py +++ b/pos_event_sale/__manifest__.py @@ -8,7 +8,7 @@ "author": "Camptocamp, Odoo Community Association (OCA)", "website": "https://github.com/OCA/pos", "category": "Marketing", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "AGPL-3", "maintainers": ["ivantodorovich"], "depends": ["event_sale", "point_of_sale"], diff --git a/pos_event_sale/models/event_event.py b/pos_event_sale/models/event_event.py index a6be5afe65..5a388e3b0d 100644 --- a/pos_event_sale/models/event_event.py +++ b/pos_event_sale/models/event_event.py @@ -42,15 +42,14 @@ def _compute_pos_price_subtotal(self): date_now = fields.Datetime.now() sale_price_by_event = {} if self.ids: - event_subtotals = self.env["pos.order.line"].read_group( + event_subtotals = self.env["pos.order.line"]._read_group( [ ("event_id", "in", self.ids), ("order_id.state", "!=", "cancel"), ("price_subtotal", "!=", 0), ], - ["event_id", "currency_id", "price_subtotal:sum"], ["event_id", "currency_id"], - lazy=False, + ["price_subtotal:sum"], ) currency_ids = [ event_subtotal["currency_id"][0] for event_subtotal in event_subtotals diff --git a/pos_event_sale/models/pos_order.py b/pos_event_sale/models/pos_order.py index 778a2b41ab..eee9fdd32a 100644 --- a/pos_event_sale/models/pos_order.py +++ b/pos_event_sale/models/pos_order.py @@ -20,10 +20,10 @@ class PosOrder(models.Model): ) def _compute_event_registrations_count(self): - count = self.env["event.registration"].read_group( + count = self.env["event.registration"]._read_group( [("pos_order_id", "in", self.ids)], - fields=["pos_order_id"], groupby=["pos_order_id"], + aggregates=["__count"], ) count_map = {x["pos_order_id"][0]: x["pos_order_id_count"] for x in count} for rec in self: diff --git a/pos_event_sale/static/src/js/Screens/PaymentScreen.js b/pos_event_sale/static/src/js/Screens/PaymentScreen.js index cb11c1eaa4..9ebb2283de 100644 --- a/pos_event_sale/static/src/js/Screens/PaymentScreen.js +++ b/pos_event_sale/static/src/js/Screens/PaymentScreen.js @@ -13,6 +13,7 @@ odoo.define("pos_event_sale.PaymentScreen", function (require) { const PosEventSalePaymentScreen = (PaymentScreen) => class extends PaymentScreen { async _postPushOrderResolve(order, server_ids) { + debugger; if (order.hasEvents()) { order.event_registrations = await this.rpc({ model: "event.registration",