[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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user