Ok got it.
I want to show the attribute table, created my own module and changed in web.py the following rules for the domains:
class Shop(metaclass=PoolMeta):
__name__ = 'web.shop'
@classmethod
def __setup__(cls):
super().__setup__()
breakpoint()
invisible = Eval('type') != 'shopify'
for field in [cls.attributes, cls.attributes_removed]:
# if field.states.get('invisible'):
# field.states['invisible'] |= invisible
# else:
# field.states['invisible'] = invisible
field.states['invisible'] = invisible # TODO: Könnte noch ein Problem werden, falls es schon einen OR Eintrag gibt
class Shop_Attribute(metaclass=PoolMeta):
__name__ = 'web.shop-product.attribute'
@classmethod
def __setup__(cls):
super().__setup__()
breakpoint()
domain = [
('type', '=', 'shopify'),
]
if cls.shop.domain:
cls.shop.domain = [cls.shop.domain, domain]
else:
cls.shop.domain = domain
Furthermore I changed product.py
class Attribute(IdentifiersUpdateMixin, metaclass=PoolMeta):
__name__ = 'product.attribute'
@classmethod
def __setup__(cls):
super().__setup__()
domain = [
('type', '=', 'shopify'),
]
if cls.web_shops.domain:
cls.web_shops.domain = [cls.web_shops.domain, domain]
else:
cls.web_shops.domain = domain
But when i want to add a attribute, it says
Which one do I miss? I can’t find this domain rule.
It would be great if you can give me some hints. Thanks!
