changeset 10cafb2d06d4 in modules/account_cash_rounding:6.0
details:
https://hg.tryton.org/modules/account_cash_rounding?cmd=changeset&node=10cafb2d06d4
description:
Import account_invoice exception when needed
account_invoice is an extras depend so it can not be imported globally.
issue11732
review418511003
(grafted from 5b18f864229837938eb759a0be556e8e636b4909)
diffstat:
account.py | 3 ++-
purchase.py | 4 ++--
sale.py | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diffs (62 lines):
diff -r 3af96d112634 -r 10cafb2d06d4 account.py
--- a/account.py Fri Nov 05 00:19:35 2021 +0100
+++ b/account.py Wed Oct 26 23:36:38 2022 +0200
@@ -8,7 +8,6 @@
from trytond.pyson import Eval
from trytond.modules.account.exceptions import AccountMissing
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
from trytond.modules.company.model import CompanyValueMixin
@@ -133,6 +132,8 @@
@fields.depends('currency', 'payment_term', 'company', 'invoice_date')
def _cash_round_total_amount(self, amount):
"Round total amount according to cash rounding"
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
if self.currency:
amounts = [amount]
if self.payment_term and self.company:
diff -r 3af96d112634 -r 10cafb2d06d4 purchase.py
--- a/purchase.py Fri Nov 05 00:19:35 2021 +0100
+++ b/purchase.py Wed Oct 26 23:36:38 2022 +0200
@@ -5,8 +5,6 @@
from trytond.pyson import Eval
from trytond.transaction import Transaction
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
-
class Purchase(metaclass=PoolMeta):
__name__ = 'purchase.purchase'
@@ -57,6 +55,8 @@
@fields.depends('currency', 'payment_term', 'company')
def _cash_round_total_amount(self, amount):
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
if self.currency:
amounts = [amount]
if self.payment_term and self.company:
diff -r 3af96d112634 -r 10cafb2d06d4 sale.py
--- a/sale.py Fri Nov 05 00:19:35 2021 +0100
+++ b/sale.py Wed Oct 26 23:36:38 2022 +0200
@@ -3,8 +3,6 @@
from trytond.model import fields
from trytond.pool import PoolMeta, Pool
-from trytond.modules.account_invoice.exceptions import PaymentTermComputeError
-
class Sale(metaclass=PoolMeta):
__name__ = 'sale.sale'
@@ -39,6 +37,8 @@
@fields.depends('currency', 'payment_term', 'company')
def _cash_round_total_amount(self, amount):
+ from trytond.modules.account_invoice.exceptions import (
+ PaymentTermComputeError)
if self.currency:
amounts = [amount]
if self.payment_term and self.company: