[FIX] purchase: use the vendor currency as default currency for vendor bills

Create a new vendor bill.
Choose a vendor with a "supplier currency" different from the company default.
The currency on the vendor bill does not change to the currency of the vendor,
unlike when a purchase order is created.

We set the currency in the partner_id onchange.

opw 1932683

closes odoo/odoo#30961
This commit is contained in:
Nans Lefebvre
2019-02-08 15:30:58 +00:00
parent 3da19480b2
commit 8d5c76cc95
@@ -146,6 +146,8 @@ class AccountInvoice(models.Model):
self.journal_id = default_journal_id
if self.env.context.get('default_currency_id'):
self.currency_id = self.env.context['default_currency_id']
if self.partner_id.property_purchase_currency_id:
self.currency_id = self.partner_id.property_purchase_currency_id
return res
@api.model