diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-12-01 14:58:52 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2017-12-04 13:57:50 +0100 |
| commit | 055f8e0fcdca7c279642c1e35fe0a1ecd84a025c (patch) | |
| tree | 7f47eedea860ecb7f53c339e3521b88a934b3d21 | |
| parent | 8b875e4dd4c20bf03452a06b7d01356367c9a605 (diff) | |
[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
| -rw-r--r-- | addons/project/models/project.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |
