From 055f8e0fcdca7c279642c1e35fe0a1ecd84a025c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 1 Dec 2017 14:58:52 +0100 Subject: [PATCH] [FIX] project: archive project Archive the associated analytic account when a project is archived. Once a porject is archived, it is assumed that we don't want to use the analytic account anymore. Moreover, it might be tempting for a user to delete these "useless" analytic accounts, and therefore it would delete the archived projects and tasks without notification. Closes #21224 opw-784685 --- addons/project/models/project.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 39a6aa468a8..77ba8a7dc48 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -264,6 +264,8 @@ class Project(models.Model): if 'active' in vals: # archiving/unarchiving a project does it on its tasks, too self.with_context(active_test=False).mapped('tasks').write({'active': vals['active']}) + # archiving/unarchiving a project implies that we don't want to use the analytic account anymore + self.with_context(active_test=False).mapped('analytic_account_id').write({'active': vals['active']}) return res @api.multi