diff --git a/sale.py b/sale.py index de63dd6db3..dbb2754426 100644 --- a/sale.py +++ b/sale.py @@ -69,7 +69,10 @@ class GiftCard(ModelSQL, ModelView): domain=[ ('gift_card', '=', True), ], - states=_states, depends=_depends) + context={ + 'company': Eval('company', -1), + }, + states=_states, depends=_depends + ['company']) value = fields.Numeric( "Value", digits=(16, Eval('currency_digits', 2)), required=True, states=_states, depends=_depends + ['currency_digits']) diff --git a/sale.xml b/sale.xml index f9c7bf5563..569487d8ab 100644 --- a/sale.xml +++ b/sale.xml @@ -93,6 +93,18 @@ this repository contains the full copyright notices and license terms. --> + + User in companies + + + + + + + + Gift Card sale.gift_card diff --git a/tests/test_sale_gift_card.py b/tests/test_sale_gift_card.py index 9903e8391a..e57739500a 100644 --- a/tests/test_sale_gift_card.py +++ b/tests/test_sale_gift_card.py @@ -10,8 +10,10 @@ from trytond.tests.test_tryton import suite as test_suite from trytond.tests.test_tryton import doctest_teardown from trytond.tests.test_tryton import doctest_checker +from trytond.modules.company.tests import CompanyTestMixin -class SaleGiftCardTestCase(ModuleTestCase): + +class SaleGiftCardTestCase(CompanyTestMixin, ModuleTestCase): 'Test Sale Gift Card module' module = 'sale_gift_card'