diff options
Diffstat (limited to 'addons/project_issue/project_issue.py')
| -rw-r--r-- | addons/project_issue/project_issue.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 61362c56f52..d2faa369392 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -120,7 +120,7 @@ class project_issue(osv.Model): if project_id: project = self.pool.get('project.project').browse(cr, uid, project_id, context=context) if project and project.partner_id: - return {'value': {'partner_id': project.partner_id.id}} + return {'value': {'partner_id': project.partner_id.id, 'email_from': project.partner_id.email}} return {} _columns = { @@ -400,6 +400,12 @@ class project_issue(osv.Model): through message_process. This override updates the document according to the email. """ + # remove default author when going through the mail gateway. Indeed we + # do not want to explicitly set user_id to False; however we do not + # want the gateway user to be responsible if no other responsible is + # found. + create_context = dict(context or {}) + create_context['default_user_id'] = False if custom_values is None: custom_values = {} context = dict(context or {}, state_to='draft') @@ -408,11 +414,10 @@ class project_issue(osv.Model): 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'partner_id': msg.get('author_id', False), - 'user_id': False, } defaults.update(custom_values) - res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=defaults, context=context) + res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=defaults, context=create_context) email_list = self.email_split(cr, uid, [res_id], msg, context=context) partner_ids = filter(None, self._find_partner_from_emails(cr, uid, [res_id], email_list, force_create=False, context=context)) self.message_subscribe(cr, uid, [res_id], partner_ids, context=context) @@ -483,7 +488,7 @@ class project(osv.Model): _columns = { 'issue_count': fields.function(_issue_count, type='integer', string="Issues",), 'issue_ids': fields.one2many('project.issue', 'project_id', string="Issues", - domain=[('stage_id.fold', '=', False)]), + domain=['|', ('stage_id.fold', '=', False), ('stage_id', '=', False)]), 'issue_needaction_count': fields.function(_issue_needaction_count, type='integer', string="Issues",), } |
