changeset 0af0af5a339b in modules/account_invoice_defer:default
details:
https://hg.tryton.org/modules/account_invoice_defer?cmd=changeset&node=0af0af5a339b
description:
Add company to on_change_invoice_line depends
issue11006
review374381002
diffstat:
account.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 3f629cbcbe63 -r 0af0af5a339b account.py
--- a/account.py Mon Jan 03 22:44:27 2022 +0100
+++ b/account.py Tue Jan 25 23:26:47 2022 +0100
@@ -164,7 +164,7 @@
if journals:
self.journal, = journals
- @fields.depends('invoice_line', 'start_date')
+ @fields.depends('invoice_line', 'start_date', 'company')
def on_change_invoice_line(self):
pool = Pool()
Currency = pool.get('currency.currency')
@@ -172,7 +172,7 @@
if not self.start_date:
self.start_date = self.invoice_line.invoice.invoice_date
invoice = self.invoice_line.invoice
- if invoice.currency != self.company.currency:
+ if self.company and invoice.currency != self.company.currency:
with Transaction().set_context(date=invoice.currency_date):
self.amount = Currency.compute(
invoice.currency, self.invoice_line.amount,