diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-12-04 20:12:19 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-12-04 20:12:19 +0100 |
| commit | a8d01cbf4ea88f894ff927a6a5424bbb58e630d0 (patch) | |
| tree | b5f52af75dec36eac2bf44941f3c5f7d8ab3a1ed /addons/project | |
| parent | 3549688b21eb65e16b9c3f2b6462eb8d8b52cd47 (diff) | |
| parent | a447da75fd6f3c76aa4db80d9a83d5e56fa0854d (diff) | |
[MERGE] forward port branch saas-15 up to a447da75fd6
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 2e108e94e3d..bfeb11ccd7f 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -245,7 +245,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 @@ -269,6 +270,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']}) if vals.get('partner_id') or vals.get('privacy_visibility'): for project in self.filtered(lambda project: project.privacy_visibility == 'portal'): project.message_subscribe(project.partner_id.ids) |
