[FIX] account_banking_sepa_direct_debit: Avoid singleton error

This commit is contained in:
Laurent Mignon (ACSONE)
2023-07-31 15:22:09 +02:00
parent 35e5de1dde
commit bf2a4e166e

View File

@@ -102,12 +102,13 @@ class AccountBankingMandate(models.Model):
)
if expired_mandates:
expired_mandates.write({"state": "expired"})
expired_mandates.message_post(
body=_(
"Mandate automatically set to expired after %d months without use."
for mandate in expired_mandates:
mandate.message_post(
body=_(
"Mandate automatically set to expired after %d months without use."
)
% NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY
)
% NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY
)
logger.info(
"%d SDD Mandate set to expired: IDs %s"
% (len(expired_mandates), expired_mandates.ids)