Skip to content

Commit

Permalink
[IMP] pos_event_sale: pre-commit execution
Browse files Browse the repository at this point in the history
  • Loading branch information
maq-adhoc committed Nov 1, 2024
1 parent f68e405 commit af04811
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pos_event_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
5 changes: 2 additions & 3 deletions pos_event_sale/models/event_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pos_event_sale/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pos_event_sale/static/src/js/Screens/PaymentScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit af04811

Please sign in to comment.