[FIX] event_sale: no company on SO
Do not crash at currency conversion when no company is set. closes odoo/odoo#34155 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -83,7 +83,9 @@ class SaleOrderLine(models.Model):
|
||||
company = self.event_id.company_id or self.env.user.company_id
|
||||
currency = company.currency_id or self.env.user.company_id.currency_id
|
||||
self.price_unit = currency._convert(
|
||||
self.event_ticket_id.price, self.order_id.currency_id, self.order_id.company_id, self.order_id.date_order or fields.Date.today())
|
||||
self.event_ticket_id.price, self.order_id.currency_id,
|
||||
self.order_id.company_id or self.env.user.company_id,
|
||||
self.order_id.date_order or fields.Date.today())
|
||||
|
||||
# we call this to force update the default name
|
||||
self.product_id_change()
|
||||
|
||||
Reference in New Issue
Block a user