Set direct debit based on party configuration if there is no payment mandate define

Closes #14702
This commit is contained in:
Cédric Krier
2026-03-24 16:36:12 +01:00
parent 4ab2b722f5
commit 283b4fc0ca
+6
View File
@@ -1384,6 +1384,9 @@ class Invoice_Payment(metaclass=PoolMeta):
invoice, attachments = super()._parse_invoice_2(root)
if root.find('./{*}PaymentMeans/{*}PaymentMandate') is not None:
invoice.payment_direct_debit = True
else:
invoice.payment_direct_debit = invoice.party.get_multivalue(
'payment_direct_debit', company=invoice.company.id)
return invoice, attachments
@classmethod
@@ -1391,6 +1394,9 @@ class Invoice_Payment(metaclass=PoolMeta):
invoice, attachments = super()._parse_invoice_2(root)
if root.find('./{*}PaymentMeans/{*}PaymentMandate') is not None:
invoice.payment_direct_debit = True
else:
invoice.payment_direct_debit = invoice.party.get_multivalue(
'payment_direct_debit', company=invoice.company.id)
return invoice, attachments