From ee184bcf589f2a6b3a32ba9d004e32eb6516a26e Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Wed, 27 Feb 2019 11:49:06 +0000 Subject: [PATCH] [FIX] event_sale: unit price changes with the qty Have a product that is an event, with the price of 1500. Create a ticket for this product in an event, with the price of 600. In a SO, add a line with this ticket. Before this commit, when you change the tickets qty in the SO the price change from 600 to 1500. Now, the unit price stays the one of the ticket. opw-1940368 --- addons/event_sale/models/sale_order.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py index 2ac4deaed5f..4b42f6d8663 100644 --- a/addons/event_sale/models/sale_order.py +++ b/addons/event_sale/models/sale_order.py @@ -64,3 +64,8 @@ class SaleOrderLine(models.Model): @api.onchange('event_ticket_id') def _onchange_event_ticket_id(self): self.price_unit = (self.event_id.company_id or self.env.user.company_id).currency_id.compute(self.event_ticket_id.price, self.order_id.currency_id) + + @api.onchange('product_uom', 'product_uom_qty') + def product_uom_change(self): + if not self.event_ticket_id: + super(SaleOrderLine, self).product_uom_change()