changeset 5b18f8642298 in modules/account_cash_rounding:default
details:
https://hg.tryton.org/modules/account_cash_rounding?cmd=changeset&node=5b18f8642298
description:
Import account_invoice exception when needed
account_invoice is an extras depend so it can not be imported globally.
issue11732
review418511003
diffstat:
account.py | 3 ++-
purchase.py | 3 ++-
sale.py | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diffs (60 lines):
diff -r 461b3f95c969 -r 5b18f8642298 account.py
--- a/account.py Sun Oct 16 14:14:09 2022 +0200
+++ b/account.py Wed Oct 26 23:36:38 2022 +0200
@@ -5,7 +5,6 @@
from trytond.i18n import gettext
from trytond.model import ModelSQL, fields
from trytond.modules.account.exceptions import AccountMissing
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
from trytond.modules.company.model import CompanyValueMixin
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval
@@ -130,6 +129,8 @@
'payment_term_date')
def _cash_round_total_amount(self, amount):
"Round total amount according to cash rounding"
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
pool = Pool()
Date = pool.get('ir.date')
if self.currency:
diff -r 461b3f95c969 -r 5b18f8642298 purchase.py
--- a/purchase.py Sun Oct 16 14:14:09 2022 +0200
+++ b/purchase.py Wed Oct 26 23:36:38 2022 +0200
@@ -1,7 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval
from trytond.transaction import Transaction
@@ -55,6 +54,8 @@
@fields.depends('currency', 'payment_term', 'company')
def _cash_round_total_amount(self, amount):
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
pool = Pool()
Date = pool.get('ir.date')
if self.currency:
diff -r 461b3f95c969 -r 5b18f8642298 sale.py
--- a/sale.py Sun Oct 16 14:14:09 2022 +0200
+++ b/sale.py Wed Oct 26 23:36:38 2022 +0200
@@ -1,7 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
@@ -39,6 +38,8 @@
@fields.depends('currency', 'payment_term', 'company')
def _cash_round_total_amount(self, amount):
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
pool = Pool()
Date = pool.get('ir.date')
if self.currency: