details:   https://code.tryton.org/tryton/commit/f3c56ffa4119
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Sep 30 15:55:59 2025 +0200
description:
        Make Shopify identifier unique per record and web shop

        Closes #14266
diffstat:

 modules/web_shop_shopify/web.py |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 414d239b31d0 -r f3c56ffa4119 modules/web_shop_shopify/web.py
--- a/modules/web_shop_shopify/web.py   Tue Sep 30 12:32:05 2025 +0200
+++ b/modules/web_shop_shopify/web.py   Tue Sep 30 15:55:59 2025 +0200
@@ -653,8 +653,8 @@
             }
         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({
@@ -662,6 +662,13 @@
                 })
 
     @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()
         Model = pool.get('ir.model')

Reply via email to