Lock only FRST SEPA mandates when processing payment group
This prevents most of the time to consume a sequence number for the group because the transaction has to restart to lock the mandates. Closes #14397
This commit is contained in:
@@ -215,7 +215,8 @@ class Group(metaclass=PoolMeta):
|
||||
if self.kind == 'receivable':
|
||||
payments = sorted(self.payments, key=attrgetter('date', 'id'))
|
||||
mandates = Payment.get_sepa_mandates(payments)
|
||||
Mandate.lock(list(filter(None, mandates)))
|
||||
Mandate.lock(
|
||||
[m for m in mandates if m and m.sequence_type == 'FRST'])
|
||||
sequence_types = {}
|
||||
for payment, mandate in zip(payments, mandates):
|
||||
if not mandate:
|
||||
|
||||
Reference in New Issue
Block a user