Add validate_fields to ModelStorage
issue11303 review386191002
This commit is contained in:
1 parent
6c6e6c7466
commit
90239f5bcf
1 file changed
+7
-6
@@ -93,12 +93,13 @@ class Shop(metaclass=PoolMeta):
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def validate(cls, shops):
|
||||
super().validate(shops)
|
||||
for shop in shops:
|
||||
if shop.type == 'shopify':
|
||||
for product in shop.products:
|
||||
shop._shopify_check_product(product)
|
||||
def validate_fields(cls, shops, field_names):
|
||||
super().validate_fields(shops, field_names)
|
||||
if field_names & {'type', 'products'}:
|
||||
for shop in shops:
|
||||
if shop.type == 'shopify':
|
||||
for product in shop.products:
|
||||
shop._shopify_check_product(product)
|
||||
|
||||
def _shopify_check_product(self, product):
|
||||
if not product.template.shopify_uom:
|
||||
|
||||
Reference in new issue
Block a user