details:   https://code.tryton.org/tryton/commit/2b03ee0515a1
branch:    default
user:      Cédric Krier <[email protected]>
date:      Thu Nov 27 15:12:45 2025 +0100
description:
        Do not delete on cascade parts of a chart of account

        Closes #14399
diffstat:

 modules/account/account.py |  2 +-
 modules/account/tax.py     |  5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 075ad1a233ff -r 2b03ee0515a1 modules/account/account.py
--- a/modules/account/account.py        Thu Nov 27 15:10:27 2025 +0100
+++ b/modules/account/account.py        Thu Nov 27 15:12:45 2025 +0100
@@ -215,7 +215,7 @@
     __name__ = 'account.account.type'
 
     parent = fields.Many2One(
-        'account.account.type', 'Parent', ondelete='CASCADE',
+        'account.account.type', 'Parent', ondelete='RESTRICT',
         states={
             'readonly': (Bool(Eval('template', -1))
                 & ~Eval('template_override', False)),
diff -r 075ad1a233ff -r 2b03ee0515a1 modules/account/tax.py
--- a/modules/account/tax.py    Thu Nov 27 15:10:27 2025 +0100
+++ b/modules/account/tax.py    Thu Nov 27 15:12:45 2025 +0100
@@ -133,7 +133,7 @@
     code = fields.Char('Code', states=_states)
     company = fields.Many2One('company.company', 'Company', required=True)
     parent = fields.Many2One(
-        'account.tax.code', "Parent", ondelete='CASCADE',
+        'account.tax.code', "Parent", ondelete='RESTRICT',
         states=_states,
         domain=[
             ('company', '=', Eval('company', -1)),
@@ -384,8 +384,7 @@
             ('credit', "Credit"),
             ], "Type", required=True, states=_states)
 
-    template = fields.Many2One(
-        'account.tax.code.line.template', 'Template', ondelete='CASCADE')
+    template = fields.Many2One('account.tax.code.line.template', "Template")
     template_override = fields.Boolean('Override Template',
         help="Check to override template definition",
         states={

Reply via email to