odoo/odoo#199469

Created by fw-bot
Merged at 8d2e112d8039bead453c4ab5f77063fcb028ef2d

Statuses:

label
odoo-dev:saas-18.1-18.0-l10n_mx_edi-fix-cancel-account-payment-loug-416380-fw
head
fad99bfdc6fea75c085ee209547bc4649fdd94d1
merged
5 months ago by Training, Louis Gobert (loug)
odoo/odoo odoo/enterprise
18.0 #198082 #79403
saas-18.1 #199469
saas-18.2 #199477
saas-18.3
saas-18.4
master #199496

[FW][FIX] l10n_mx_edi: cancel payment when move is canceled

Since Odoo 18.0, account.payment no longer inherits from account.move. As a result, canceling a payment with _l10n_mx_edi_cfdi_move_post_cancel does not automatically cancel the associated payment record.

Steps to reproduce:
- Ensure the Mexican localization is installed and properly configured.
- Generate an invoice and sign it with the government (CFDI).
- Create and sign a payment for the invoice.
- Cancel the payment from the CFDI table.

Current behavior:
- Odoo cancels the move, but the related payment remains posted.

Expected behavior:
- The payment should also be canceled when the move is canceled.

This fix ensures that the associated payment is canceled correctly.

opw-4528910

Forward-Port-Of: #198082