summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-02-13 14:32:08 +0100
committerNicolas Martinelli <nim@odoo.com>2017-02-13 14:32:08 +0100
commit4a33db44b270c1fbfd5842acb8d5bbbf069e6c8b (patch)
tree451b3289b68221d86443217744a5635f851c590a
parentdefbe247e855e6fc61c7cc8560d73e5d3e41626d (diff)
[FIX] account: crash if no currency in payment
- Register a payment on an invoice - Do not set a journal, and do not set a currency - Change the amount It crashes. opw-706807
-rw-r--r--addons/account/models/account_payment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
index ed29d95aa30..c1768cc8da3 100644
--- a/addons/account/models/account_payment.py
+++ b/addons/account/models/account_payment.py
@@ -81,7 +81,7 @@ class account_abstract_payment(models.AbstractModel):
def _compute_total_invoices_amount(self):
""" Compute the sum of the residual of invoices, expressed in the payment currency """
- payment_currency = self.currency_id or self.journal_id.currency_id or self.journal_id.company_id.currency_id
+ payment_currency = self.currency_id or self.journal_id.currency_id or self.journal_id.company_id.currency_id or self.env.user.company_id.currency_id
invoices = self._get_invoices()
if all(inv.currency_id == payment_currency for inv in invoices):