Add test on context of company multivalue target fields

issue10067
review333851026
This commit is contained in:
Cédric Krier committed 2021-03-05 15:49:19 +01:00
1 parent c695033e75
commit ab6d9ea685
2 files changed
+8 -3

No files matched your search

+5 -1
View File
@@ -134,7 +134,11 @@ class PartyCreditLimitAmount(ModelSQL, CompanyValueMixin):
"Party Credit Limit Amount"
__name__ = 'party.party.credit_limit_amount'
party = fields.Many2One(
'party.party', "Party", ondelete='CASCADE', select=True)
'party.party', "Party", ondelete='CASCADE', select=True,
context={
'company': Eval('company', -1),
},
depends=['company'])
credit_limit_amount = fields.Numeric(
"Credit Limit Amount", digits=(16, Eval('credit_limit_digits', 2)),
depends=['credit_limit_digits'])
+3 -2
View File
@@ -8,11 +8,12 @@ from trytond.tests.test_tryton import ModuleTestCase, with_transaction
from trytond.pool import Pool
from trytond.exceptions import UserError, UserWarning
from trytond.modules.company.tests import create_company, set_company
from trytond.modules.company.tests import (
create_company, set_company, CompanyMultiValueTestMixin)
from trytond.modules.account.tests import create_chart, get_fiscalyear
class AccountCreditLimitTestCase(ModuleTestCase):
class AccountCreditLimitTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
'Test AccountCreditLimit module'
module = 'account_credit_limit'
extras = ['account_dunning']