[IMP] payment: use ondelete instead of custom error

Use generic method on_delete instead of personalized one for the sake of
clarity and reproductibility.

task-2883630

closes odoo/odoo#99958

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Valentin Vallaeys (vava)
2022-09-16 19:17:05 +02:00
parent af320bad34
commit efbf0c0838
3 changed files with 6 additions and 19 deletions
+6 -2
View File
@@ -68,11 +68,15 @@ class PaymentProvider(models.Model):
redirect_form_view_id = fields.Many2one(
string="Redirect Form Template", comodel_name='ir.ui.view',
help="The template rendering a form submitted to redirect the user when making a payment",
domain=[('type', '=', 'qweb')])
domain=[('type', '=', 'qweb')],
ondelete='restrict',
)
inline_form_view_id = fields.Many2one(
string="Inline Form Template", comodel_name='ir.ui.view',
help="The template rendering the inline payment form when making a direct payment",
domain=[('type', '=', 'qweb')])
domain=[('type', '=', 'qweb')],
ondelete='restrict',
)
token_inline_form_view_id = fields.Many2one(
string="Token Inline Form Template",
comodel_name='ir.ui.view',