Import account_invoice exception when needed
account_invoice is an extras depend so it can not be imported globally. issue11732 review418511003
This commit is contained in:
+2
-1
@@ -5,7 +5,6 @@ from decimal import Decimal
|
||||
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 @@ class Invoice(metaclass=PoolMeta):
|
||||
'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:
|
||||
|
||||
+2
-1
@@ -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 @@ class Purchase(metaclass=PoolMeta):
|
||||
|
||||
@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:
|
||||
|
||||
@@ -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 @@ class Sale(metaclass=PoolMeta):
|
||||
|
||||
@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:
|
||||
|
||||
Reference in New Issue
Block a user