summaryrefslogtreecommitdiff
path: root/addons/project_issue/project_issue.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-04-01 18:50:51 +0200
committerChristophe Simonis <chs@odoo.com>2016-04-01 18:51:55 +0200
commit6e95659a088934aab2f7ffb1a088879256e55e78 (patch)
tree0fa63393564c4b8299ed06c4dd417e86e0439190 /addons/project_issue/project_issue.py
parent24833272369649b10a691da4c2f0434069fb4ed7 (diff)
parentf4d1adc116f226e5ccdbda114248848d4eb9ebfc (diff)
[MERGE] forward port of branch saas-9 up to f4d1adc
Diffstat (limited to 'addons/project_issue/project_issue.py')
-rw-r--r--addons/project_issue/project_issue.py13
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",),
}