diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-05-29 15:14:58 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-05-29 15:14:58 +0200 |
| commit | d4dbd3524ca7e886376d3b4fd79427bdd3e80d34 (patch) | |
| tree | 9bbb3690f4167eda753c6c6e89d6844e3fbc3e9d /addons/project_issue/project_issue.py | |
| parent | dc858b099ef60f75b92c8b15e0e34ab6db84cb3b (diff) | |
[FIX] mail, project, project_issue, crm_lead: fixed 'XX Created' subtype not triggered because of condition
based on state=new and not state=draft.
For tasks, issues and leads, no generic 'Document created' message is posted anymore
because of the 'XX Created' message with subtype automatically logged.
Generic creation message is logged before automatic subscription to enable
message pushing to responsibles.
bzr revid: tde@openerp.com-20130529131458-9709ffrsy479hwy3
Diffstat (limited to 'addons/project_issue/project_issue.py')
| -rw-r--r-- | addons/project_issue/project_issue.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index bd5dff89413..c334f5f67ef 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -50,12 +50,12 @@ class project_issue(base_stage, osv.osv): _track = { 'state': { - 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'new', + 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj['state'] in ['new', 'draft'], 'project_issue.mt_issue_closed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done', 'project_issue.mt_issue_started': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'open', }, 'stage_id': { - 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'done', 'open'], + 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj['state'] not in ['new', 'draft', 'done', 'open'], }, 'kanban_state': { 'project_issue.mt_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked', @@ -70,7 +70,9 @@ class project_issue(base_stage, osv.osv): if vals.get('project_id'): ctx['default_project_id'] = vals['project_id'] vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx) - return super(project_issue, self).create(cr, uid, vals, context=context) + # context: no_log, because subtype already handle this + create_context = dict(context, mail_create_nolog=True) + return super(project_issue, self).create(cr, uid, vals, context=create_context) def _get_default_project_id(self, cr, uid, context=None): """ Gives default project by checking if present in the context """ |
