diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-12-06 12:02:58 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-12-06 12:02:58 +0100 |
| commit | 8ef7af6afe54fbd59051bbbce76daadd6fdb0e86 (patch) | |
| tree | b21971e972eacc87e198fbc38b48ac9b70d168fc /addons/project | |
| parent | 010add290342ae1e2887450a381e0d1f0acd34e5 (diff) | |
| parent | f96a797fe6238306ec70d3db013b8a4d348ef181 (diff) | |
[MERGE] forward port branch 11.0 up to f96a797fe62
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 1b17a1176fa..2bb472fa2c3 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 @@ -265,6 +266,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) |
