Skip to content
Snippets Groups Projects
Commit 3b6ddb91 authored by Adrian Torres's avatar Adrian Torres
Browse files

[FIX] payment: properly uninstall if transaction exists


Before this commit:
    - Install the `payment` module
    - Generate a `payment.transaction`
    - Try to uninstall the `payment` module
    -> Uninstall process crashes and the DB is rolled back

This happens because the field `acquirer_id` of the model
`payment.transaction` is a required many2one with ondelete='set null'
(the default), this of course makes no sense, and when the ORM tries to
set the field of these records to NULL, it crashes.

This has been fixed globally in saas-12.2 at ee6dc40a but for stable
versions it is best to simply simulate the behavior of an
ondelete='cascade' which is what this commit does via an uninstall_hook

Fixes #37379

closes odoo/odoo#37422

Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
parent 62056e82
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment