Lock the table before checking uniqueness of coupon number

Closes #13011
(grafted from eb6278d920c1c9dcbb62dd8e023f63c7b0388173)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2024-02-06 23:53:28 +01:00
parent 466f2114b6
commit dbe08ad3b4
+1
View File
@@ -155,6 +155,7 @@ class PromotionCouponNumber(DeactivableMixin, ModelSQL, ModelView):
def check_unique(cls, numbers, field_names=None):
if field_names and not (field_names & {'number', 'coupon'}):
return
cls.lock()
duplicates = []
for sub_numbers in grouped_slice(numbers):
domain = ['OR']