changeset 9e0083eba168 in modules/web_shop_shopify:default details: https://hg.tryton.org/modules/web_shop_shopify?cmd=changeset&node=9e0083eba168 description: Send only the required fields when fetching a readonly view definition
issue11134 review380081002 diffstat: product.py | 12 ++++-------- web.py | 19 +++++++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diffs (101 lines): diff -r 631a1eb1c574 -r 9e0083eba168 product.py --- a/product.py Wed Apr 06 23:37:45 2022 +0200 +++ b/product.py Fri Apr 08 19:07:14 2022 +0200 @@ -75,7 +75,7 @@ 'readonly': Bool(Eval('shopify_identifiers', [-1])), 'invisible': ~Eval('salable', False), }, - depends=['default_uom_category', 'shopify_identifiers', 'salable']) + depends={'default_uom_category'}) @classmethod def __setup__(cls): @@ -89,7 +89,6 @@ ('category', 'in', [Eval(c, -1) for c in categories]), ('digits', '=', 0), ] - cls.shopify_uom.depends.extend(categories) @classmethod def _shopify_uom_categories(cls): @@ -471,8 +470,7 @@ If(Eval('shopify_option3'), ('id', '!=', Eval('shopify_option3')), ()), - ], - depends=['attributes', 'shopify_option2', 'shopify_option3']) + ]) shopify_option2 = fields.Many2One( 'product.attribute', "Option 2", domain=[ @@ -486,8 +484,7 @@ ], states={ 'invisible': ~Eval('shopify_option1'), - }, - depends=['attributes', 'shopify_option1', 'shopify_option3']) + }) shopify_option3 = fields.Many2One( 'product.attribute', "Option 3", domain=[ @@ -501,8 +498,7 @@ ], states={ 'invisible': ~Eval('shopify_option2'), - }, - depends=['attributes', 'shopify_option1', 'shopify_option2']) + }) @classmethod def __setup__(cls): diff -r 631a1eb1c574 -r 9e0083eba168 web.py --- a/web.py Wed Apr 06 23:37:45 2022 +0200 +++ b/web.py Fri Apr 08 19:07:14 2022 +0200 @@ -32,32 +32,28 @@ 'required': Eval('type') == 'shopify', 'invisible': Eval('type') != 'shopify', } - _depends = ['type'] - shopify_url = fields.Char("Shop URL", states=_states, depends=_depends) + shopify_url = fields.Char("Shop URL", states=_states) shopify_version = fields.Selection( - 'get_shopify_versions', "Version", states=_states, depends=_depends) - shopify_password = fields.Char( - "Password", states=_states, depends=_depends) + 'get_shopify_versions', "Version", states=_states) + shopify_password = fields.Char("Password", states=_states) shopify_webhook_shared_secret = fields.Char( "Webhook Shared Secret", states={ 'invisible': _states['invisible'], - }, - depends=_depends) + }) shopify_webhook_endpoint_order = fields.Function( fields.Char( "Webhook Order Endpoint", help="The URL to be called by Shopify for Order events."), 'on_change_with_shopify_webhook_endpoint_order') shopify_warehouses = fields.One2Many( - 'web.shop-stock.location', 'shop', "Warehouses", - states=_states, depends=_depends) + 'web.shop-stock.location', 'shop', "Warehouses", states=_states) shopify_payment_journals = fields.One2Many( 'web.shop.shopify_payment_journal', 'shop', "Payment Journals", - states=_states, depends=_depends) + states=_states) - del _states, _depends + del _states @classmethod def __setup__(cls): @@ -69,7 +65,6 @@ field.states['invisible'] |= invisible else: field.states['invisible'] = invisible - field.depends.append('type') @classmethod def get_shopify_versions(cls):