diff --git a/addons/account/models/account_report.py b/addons/account/models/account_report.py index ed0fafe4472..265ffffcc18 100644 --- a/addons/account/models/account_report.py +++ b/addons/account/models/account_report.py @@ -833,7 +833,7 @@ class AccountReportExternalValue(models.Model): text_value = fields.Char(string="Text Value") date = fields.Date(required=True) - target_report_expression_id = fields.Many2one(string="Target Expression", comodel_name="account.report.expression", required=True) + target_report_expression_id = fields.Many2one(string="Target Expression", comodel_name="account.report.expression", required=True, ondelete="cascade") target_report_line_id = fields.Many2one(string="Target Line", related="target_report_expression_id.report_line_id") target_report_expression_label = fields.Char(string="Target Expression Label", related="target_report_expression_id.label") report_country_id = fields.Many2one(string="Country", related='target_report_line_id.report_id.country_id')