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:20 +01:00
1 parent 392ec4434a
commit f406e48d9e
2 files changed
+25 -2

No files matched your search

+3 -1
View File
@@ -7,8 +7,10 @@ import unittest
from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import suite as test_suite
from trytond.modules.company.tests import CompanyMultiValueTestMixin
class WebShopTestCase(ModuleTestCase):
class WebShopTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
'Test Web Shop module'
module = 'web_shop'
extras = ['product_attribute']
+22 -1
View File
@@ -64,23 +64,44 @@ class Shop(DeactivableMixin, ModelSQL, ModelView):
domain=[
('type', '=', 'warehouse'),
])
guest_party = fields.Many2One('party.party', "Guest Party")
guest_party = fields.Many2One(
'party.party', "Guest Party",
context={
'company': Eval('company', -1),
},
depends=['company'])
products = fields.Many2Many(
'web.shop-product.product', 'shop', 'product', "Products",
domain=[
('salable', '=', True),
],
context={
'company': Eval('company', -1),
},
depends=['company'],
help="The list of products to publish.")
products_removed = Many2ManyInactive(
'web.shop-product.product', 'shop', 'product', "Products Removed",
context={
'company': Eval('company', -1),
},
depends=['company'],
help="The list of products to unpublish.")
categories = fields.Many2Many(
'web.shop-product.category', 'shop', 'category', "Categories",
context={
'company': Eval('company', -1),
},
depends=['company'],
help="The list of categories to publish.")
categories_removed = Many2ManyInactive(
'web.shop-product.category', 'shop', 'category', "Categories Removed",
context={
'company': Eval('company', -1),
},
depends=['company'],
help="The list of categories to unpublish.")
_name_cache = Cache('web.shop.name', context=False)