From e6536f878e2b8ff92b72590f12c7251c447b83ca Mon Sep 17 00:00:00 2001 From: "Valentin Vallaeys (vava)" Date: Mon, 19 Sep 2022 07:42:54 +0000 Subject: [PATCH] [IMP] payment: use ondelete to restrict deletion Restrict deletion of token and express checkout inline forms when a payment provider is using it Continuity of https://github.com/odoo/odoo/commit/efbf0c08382a9eddaa48bb386912e5c1925bbfc0 task-2883630 closes odoo/odoo#100466 Signed-off-by: Antoine Vandevenne (anv) --- addons/payment/models/payment_provider.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/payment/models/payment_provider.py b/addons/payment/models/payment_provider.py index 0e52be26180..4cd2d4d6fdd 100644 --- a/addons/payment/models/payment_provider.py +++ b/addons/payment/models/payment_provider.py @@ -82,12 +82,14 @@ class PaymentProvider(models.Model): comodel_name='ir.ui.view', help="The template rendering the inline payment form when making a payment by token.", domain=[('type', '=', 'qweb')], + ondelete='restrict', ) express_checkout_form_view_id = fields.Many2one( string="Express Checkout Form Template", comodel_name='ir.ui.view', help="The template rendering the express payment methods' form.", domain=[('type', '=', 'qweb')], + ondelete='restrict', ) # Availability fields.