diff --git a/party.py b/party.py index 9506398194..ad92a09c12 100644 --- a/party.py +++ b/party.py @@ -36,7 +36,11 @@ class PartySalePriceList(ModelSQL, CompanyValueMixin): "Party Sale Price List" __name__ = 'party.party.sale_price_list' party = fields.Many2One( - 'party.party', "Party", ondelete='CASCADE', select=True) + 'party.party', "Party", ondelete='CASCADE', select=True, + context={ + 'company': Eval('company', -1), + }, + depends=['company']) sale_price_list = fields.Many2One( 'product.price_list', "Sale Price List", domain=[ diff --git a/tests/test_sale_price_list.py b/tests/test_sale_price_list.py index b2136afe10..3e87624d74 100644 --- a/tests/test_sale_price_list.py +++ b/tests/test_sale_price_list.py @@ -7,8 +7,10 @@ from trytond.tests.test_tryton import ModuleTestCase from trytond.tests.test_tryton import doctest_teardown from trytond.tests.test_tryton import doctest_checker +from trytond.modules.company.tests import CompanyMultiValueTestMixin -class SalePriceListTestCase(ModuleTestCase): + +class SalePriceListTestCase(CompanyMultiValueTestMixin, ModuleTestCase): 'Test SalePriceList module' module = 'sale_price_list'