diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-02-08 15:26:47 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-02-08 15:30:58 +0000 |
| commit | 8d5c76cc95d22798e0517640714f4f4fb4080235 (patch) | |
| tree | 8b24d133699b6bffe39dabba2d56f081696935ae | |
| parent | 3da19480b24ee6c12569e77bd765ad561cc2e312 (diff) | |
[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
| -rw-r--r-- | addons/purchase/models/account_invoice.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index e9d601ee9f7..4ac0a3a4156 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -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 |
