I found an asymmetry in account_payment and I am not sure what the intended behavior is.
A party has two different direct debit settings:
payment_direct_debit, whose help says it is used when the supplier does direct debit.reception_direct_debits, used to debit the customer.
For a positive supplier invoice with payment_direct_debit=True, the pending line is payable and is excluded from “Lines to Pay”.
For a negative supplier invoice, the pending line becomes receivable but keeps payment_direct_debit=True. The receivable domain does not filter this field, so the line is shown. If the party also has a direct debit reception as a customer, the “Create Direct Debit” wizard can create a receivable payment for it and SEPA may use the customer mandate.
The difference comes from the domains:
Payable:
credit > 0 or debit < 0
payment_direct_debit = False
Receivable:
debit > 0 or credit < 0
The receivable classification of the supplier credit note seems correct. What is unclear is whether changing the sign should also change which direct debit configuration applies.
There is a related case with customer invoices. on_change_party copies party.payment_direct_debit without checking the invoice type. A customer invoice for a party that is also a supplier therefore carries this hidden supplier setting. A negative customer invoice becomes payable and is excluded from the payable lines. There is already a scenario checking that payment_direct_debit is copied to an outgoing invoice, so this may be intentional.
Should payment_direct_debit apply only to supplier invoices? And for a supplier credit note, should it remain in the supplier direct debit workflow, probably to be grouped with future invoices, or should it become an ordinary receivable eligible for reception_direct_debits?
This seems related to grouping receivable/payable lines and direct debit based on balance, but neither clarifies which direct debit setting should apply when the invoice sign is reversed.
From my point of view, the invoice type should decide which direct debit setting applies. payment_direct_debit should only be copied to supplier invoices, including credit notes, while reception_direct_debits should only apply to customer invoices. A supplier credit note could still be classified as receivable, but it should not become eligible for the customer direct debit workflow just because its sign changed. It should remain in the supplier workflow, where it can be grouped with later supplier invoices or handled as a refund.