From 0f331ef1feef700d1a39234f4be5150193120839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 30 Sep 2025 15:55:59 +0200 Subject: [PATCH] Make Shopify identifier unique per record and web shop Closes #14266 --- modules/web_shop_shopify/web.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/web_shop_shopify/web.py b/modules/web_shop_shopify/web.py index 71bc8c3e37..c1d41fc5b7 100644 --- a/modules/web_shop_shopify/web.py +++ b/modules/web_shop_shopify/web.py @@ -653,14 +653,21 @@ class ShopShopifyIdentifier(IdentifierMixin, ModelSQL, ModelView): } t = cls.__table__() cls._sql_constraints += [ - ('record_web_shop_unique', - Unique(t, t.record, t.shopify_identifier_signed), + ('web_shop_record_unique', + Unique(t, t.record, t.web_shop), 'web_shop_shopify.msg_identifier_record_web_shop_unique'), ] cls._buttons.update({ 'set_to_update': {}, }) + @classmethod + def __register__(cls, module): + table_h = cls.__table_handler__(module) + super().__register__(module) + # Migration from 7.6: replace record_web_shop_unique + table_h.drop_constraint('record_web_shop_unique') + @classmethod def get_records(cls): pool = Pool()