From 90239f5bcf33007fdb9f4431634f62787a29c170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 11 Apr 2022 23:24:21 +0200 Subject: [PATCH] Add validate_fields to ModelStorage issue11303 review386191002 --- web.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/web.py b/web.py index e5d8ecd681..ec507cb466 100644 --- a/web.py +++ b/web.py @@ -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: