changeset e673033fdd74 in modules/sale_subscription:default
details: 
https://hg.tryton.org/modules/sale_subscription?cmd=changeset;node=e673033fdd74
description:
        Add test on context of company multivalue target fields

        issue10067
        review333851026
diffstat:

 subscription.py                 |  16 +++++++++++++---
 tests/test_sale_subscription.py |   7 +++++--
 2 files changed, 18 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r dac11dd73607 -r e673033fdd74 subscription.py
--- a/subscription.py   Sat Feb 27 18:16:29 2021 +0100
+++ b/subscription.py   Fri Mar 05 15:49:20 2021 +0100
@@ -60,22 +60,32 @@
             'readonly': ((Eval('state') != 'draft')
                 | (Eval('lines', [0]) & Eval('party'))),
             },
-        depends=['state'],
+        context={
+            'company': Eval('company', -1),
+            },
+        depends=['state', 'company'],
         help="The party who subscribes.")
     contact = fields.Many2One(
         'party.contact_mechanism', "Contact",
+        context={
+            'company': Eval('company', -1),
+            },
         search_context={
             'related_party': Eval('party'),
-            })
+            },
+        depends=['company', 'party'])
     invoice_party = fields.Many2One('party.party', "Invoice Party",
         states={
             'readonly': ((Eval('state') != 'draft')
                 | Eval('lines', [0])),
             },
+        context={
+            'company': Eval('company', -1),
+            },
         search_context={
             'related_party': Eval('party'),
             },
-        depends=['state', 'party'])
+        depends=['state', 'company', 'party'])
     invoice_address = fields.Many2One(
         'party.address', "Invoice Address",
         domain=[
diff -r dac11dd73607 -r e673033fdd74 tests/test_sale_subscription.py
--- a/tests/test_sale_subscription.py   Sat Feb 27 18:16:29 2021 +0100
+++ b/tests/test_sale_subscription.py   Fri Mar 05 15:49:20 2021 +0100
@@ -10,10 +10,13 @@
 from trytond.tests.test_tryton import doctest_teardown
 from trytond.tests.test_tryton import doctest_checker
 
-from trytond.modules.company.tests import PartyCompanyCheckEraseMixin
+from trytond.modules.company.tests import (
+    PartyCompanyCheckEraseMixin, CompanyMultiValueTestMixin)
 
 
-class SaleSubscriptionTestCase(PartyCompanyCheckEraseMixin, ModuleTestCase):
+class SaleSubscriptionTestCase(
+        PartyCompanyCheckEraseMixin, CompanyMultiValueTestMixin,
+        ModuleTestCase):
     'Test Sale Subscription module'
     module = 'sale_subscription'
 

Reply via email to