[IMP] payment_authorize: avoid setting VOID transactions as canceled I#3817#633
[IMP] payment_authorize: avoid setting VOID transactions as canceled I#3817#633jqbeltran2 wants to merge 1 commit intoVauxoo:16.0-ircfrom
Conversation
There was a problem hiding this comment.
I think you could avoid this patch
Using a inherit class and using _set_canceled
I mean,
class ...
_inherit = "payment.transaction"
def _set_canceled(...):
if self.provider_code == 'authorize':
self.transaction_status = 'voided'
else:
return super()._set_canceled()Or something similar
cc @fernandahf
There was a problem hiding this comment.
Not all scenarios where it's canceled are because of a void; it could be declined by the provider. How do we know what the difference is?
There was a problem hiding this comment.
You can use a context in the patch and process this context in the inherited method
There was a problem hiding this comment.
Avoid creating fields in this part
Better using the module inherited
Maybe if you need to patch the method, you could use a context in order to be re-used in the method inherited
There was a problem hiding this comment.
Done, I defined the field in our inherit
There was a problem hiding this comment.
The original tests are not ran in the pipeline
So, this change is not needed neither
If you need a custom tests, you can create them in the custom modules
There was a problem hiding this comment.
Done, I deleted the unit tests changes
dd04aaf to
6c0b8c2
Compare
|
I don't understood the new implementation I was thinking about using the same I mean,
|
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. To identify voided payment.transaction records, the context "transaction_voided" is provided.
6c0b8c2 to
d5fce03
Compare
|
Changes applied |
Description of the issue/feature this PR addresses:
https://gitlab.com/ircanada/ircodoo/-/issues/3721
https://gitlab.com/ircanada/ircodoo/-/issues/3817
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.
To identify voided payment.transaction records, the context "transaction_voided" is provided where previously they were marked as canceled.
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.