Skip to content

[IMP] payment_authorize: avoid setting VOID transactions as canceled#631

Open
jqbeltran2 wants to merge 1 commit intoVauxoo:16.0-ircfrom
vauxoo-dev:16.0-irc-avoid-cancel-void-transactions-jqbeltran2
Open

[IMP] payment_authorize: avoid setting VOID transactions as canceled#631
jqbeltran2 wants to merge 1 commit intoVauxoo:16.0-ircfrom
vauxoo-dev:16.0-irc-avoid-cancel-void-transactions-jqbeltran2

Conversation

@jqbeltran2
Copy link

Description of the issue/feature this PR addresses:

https://gitlab.com/ircanada/ircodoo/-/issues/3721

This commit removes calls to _set_canceled() for VOID-type transactions.
For proper reconciliation, VOID transactions must remain in the posted state
and should not be marked as canceled in the payment.transaction record.

Unit tests were adjusted accordingly.

Current behavior before PR:

The payment.transaction and account.payment records related to an invoice were being canceled when generating a VOID transaction.

Desired behavior after PR is merged:

Both payment.transaction and account.payment records related to an invoice should remain in the posted state to allow automatic reconciliation of the invoice for the client's requirements.


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

This commit removes calls to `_set_canceled()` for VOID-type transactions.
For proper reconciliation, VOID transactions must remain in the `posted` state
and should not be marked as canceled in the `payment.transaction` record.

The unit test were adjusted.
@jqbeltran2 jqbeltran2 changed the base branch from 16.0 to 16.0-irc July 3, 2025 17:59
@jqbeltran2
Copy link
Author

Hi @fernandahf

Could you please review this PR? Thanks!

@fernandahf
Copy link

fernandahf commented Jul 3, 2025

@hbto

Could you take a look at this, please?

@hbto
Copy link

hbto commented Jul 8, 2025

@hbto

Could you take a look at this, please?

@fernandahf @rolandojduartem Looks good to me

@rolandojduartem
Copy link

@jqbeltran2 could help me with the context of this PR?

cc @moylop260

@jqbeltran2
Copy link
Author

jqbeltran2 commented Jul 9, 2025

@jqbeltran2 could help me with the context of this PR?

cc @moylop260

@rolandojduartem @moylop260 sure thing:

This specific PR aims to fix a particular behavior in the current auto-reconciliation process implementation, which does not work correctly for transaction.reconciliation records of type VOID. In these cases, neither the invoice nor the credit note gets automatically reconciled.

For the invoice, the issue arises because, being a VOID transaction, Odoo's default logic triggers the _set_canceled() function, which cancels the related payment and journal entry. Since both are in a canceled state, they cannot be reconciled as expected by IRC, which requires them to be in a posted state.

This PR specifically removes those function calls so that the payment and journal entry remain posted in the case of Authorize.Net transactions.

This PR is part of the MR: https://gitlab.com/ircanada/ircodoo/-/merge_requests/3961

@rolandojduartem
Copy link

LGTM, I left some comments in MR cc @moylop260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants