diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-09-03 23:57:57 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-09-03 23:57:57 +0200 |
| commit | 1a77d9d02a9cdfc13cb38a1f60a027310a278dce (patch) | |
| tree | cd11d1fb7b0d171d740a0edcf5e0fe0669bdae5e /addons/project_issue/models/project_issue.py | |
| parent | 6d9b4de9392a6bad605229401832db876885cdaf (diff) | |
| parent | 476cb5a0902fefc528b9c472e4b1f14f0fdba47d (diff) | |
[MERGE] forward port branch saas-12 up to 476cb5a0
Diffstat (limited to 'addons/project_issue/models/project_issue.py')
| -rw-r--r-- | addons/project_issue/models/project_issue.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/addons/project_issue/models/project_issue.py b/addons/project_issue/models/project_issue.py index 0b38b972494..64e027d6b35 100644 --- a/addons/project_issue/models/project_issue.py +++ b/addons/project_issue/models/project_issue.py @@ -15,7 +15,10 @@ class ProjectIssue(models.Model): @api.model def _get_default_stage_id(self): - return self.stage_find(self.env.context.get('default_project_id'), [('fold', '=', False)]) + project_id = self.env.context.get('default_project_id') + if not project_id: + return False + return self.stage_find(project_id, [('fold', '=', False)]) name = fields.Char(string='Issue', required=True) active = fields.Boolean(default=True) @@ -60,9 +63,9 @@ class ProjectIssue(models.Model): user_email = fields.Char(related='user_id.email', string='User Email', readonly=True) date_action_last = fields.Datetime(string='Last Action', readonly=True) date_action_next = fields.Datetime(string='Next Action', readonly=True) - legend_blocked = fields.Char(related="stage_id.legend_blocked", string='Kanban Blocked Explanation') - legend_done = fields.Char(related="stage_id.legend_done", string='Kanban Valid Explanation') - legend_normal = fields.Char(related="stage_id.legend_normal", string='Kanban Ongoing Explanation') + legend_blocked = fields.Char(related="stage_id.legend_blocked", string='Kanban Blocked Explanation', readonly=True) + legend_done = fields.Char(related="stage_id.legend_done", string='Kanban Valid Explanation', readonly=True) + legend_normal = fields.Char(related="stage_id.legend_normal", string='Kanban Ongoing Explanation', readonly=True) @api.multi def _read_group_stage_ids(self, domain, read_group_order=None, access_rights_uid=None): @@ -136,6 +139,11 @@ class ProjectIssue(models.Model): if self.project_id: self.partner_id = self.project_id.partner_id.id self.email_from = self.project_id.partner_id.email + self.stage_id = self.stage_find(self.project_id.id, [('fold', '=', False)]) + else: + self.partner_id = False + self.email_from = False + self.stage_id = False @api.onchange('task_id') def _onchange_task_id(self): @@ -245,6 +253,8 @@ class ProjectIssue(models.Model): group_data['group_project_user'] |= recipient elif not recipient.user_ids: group_data['partner'] |= recipient + elif all(recipient.user_ids.mapped('share')): + group_data['partner'] |= recipient else: group_data['user'] |= recipient done_ids.add(recipient.id) |
