Lock the table before checking uniqueness of coupon number
Closes #13011 (grafted from eb6278d920c1c9dcbb62dd8e023f63c7b0388173) --HG-- branch : 7.0
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user