diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-12-04 19:25:51 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-12-04 19:25:51 +0100 |
| commit | a447da75fd6f3c76aa4db80d9a83d5e56fa0854d (patch) | |
| tree | 5d19dd629b4498f16d24d20085aee391b6b06fad /addons/project | |
| parent | 863fad1b535b05e2fd61b29888f492290c1aa7a5 (diff) | |
| parent | e7d174a1422e2f8bfd849134767d5f43383599b0 (diff) | |
[MERGE] forward port branch saas-14 up to e7d174a1422
Diffstat (limited to 'addons/project')
| -rw-r--r-- | addons/project/models/project.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 5f1b2996ec4..36310219909 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -243,7 +243,8 @@ class Project(models.Model): project = super(Project, self).copy(default) for follower in self.message_follower_ids: project.message_subscribe(partner_ids=follower.partner_id.ids, subtype_ids=follower.subtype_ids.ids) - self.map_tasks(project.id) + if 'tasks' not in default: + self.map_tasks(project.id) return project @api.model @@ -264,6 +265,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 |
