[FIX] account: Resolve foreign key constraint failure on PML deletion

- Added ondelete='cascade' to account_payment_method_line's
field definition.
- Fixes the foreign key constraint failure during module uninstallation
by automatically deleting dependent records.

task-3326945

X-original-commit: 9c10cf4dc1da36a2ef826962887a6538d0c522a2
Part-of: odoo/odoo#135696
This commit is contained in:
moerradi
2023-09-18 22:17:11 +00:00
parent 0983809f6e
commit 7e8185ba20
@@ -100,7 +100,8 @@ class AccountPaymentMethodLine(models.Model):
string='Payment Method',
comodel_name='account.payment.method',
domain="[('payment_type', '=?', payment_type), ('id', 'in', available_payment_method_ids)]",
required=True
required=True,
ondelete='cascade'
)
payment_account_id = fields.Many2one(
comodel_name='account.account',