Add test on context of company multivalue target fields

issue10067
review333851026
This commit is contained in:
Cédric Krier
2021-03-05 15:49:19 +01:00
parent b834f84761
commit 9d3b47ecde
2 changed files with 14 additions and 5 deletions
+11 -3
View File
@@ -62,8 +62,13 @@ INITIATOR_IDS = [
class Journal(metaclass=PoolMeta):
__name__ = 'account.payment.journal'
company_party = fields.Function(fields.Many2One('party.party',
'Company Party'), 'on_change_with_company_party')
company_party = fields.Function(fields.Many2One(
'party.party', "Company Party",
context={
'company': Eval('company', -1),
},
depends=['company']),
'on_change_with_company_party')
sepa_bank_account_number = fields.Many2One('bank.account.number',
'Bank Account Number', states={
'required': Eval('process_method') == 'sepa',
@@ -409,7 +414,10 @@ class Mandate(Workflow, ModelSQL, ModelView):
'readonly': Eval('state').in_(
['requested', 'validated', 'cancelled']),
},
depends=['state'])
context={
'company': Eval('company', -1),
},
depends=['state', 'company'])
account_number = fields.Many2One('bank.account.number', 'Account Number',
ondelete='RESTRICT',
states={
+3 -2
View File
@@ -15,7 +15,8 @@ from trytond.modules.account_payment_sepa.payment import CAMT054
from trytond.pool import Pool
from trytond.modules.currency.tests import create_currency
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
@@ -147,7 +148,7 @@ def validate_file(flavor, kind, xsd=None):
schema.assertValid(sepa_xml)
class AccountPaymentSepaTestCase(ModuleTestCase):
class AccountPaymentSepaTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
'Test Account Payment SEPA module'
module = 'account_payment_sepa'