From e28677f727b0218f037417d912f42a143c5bc52c Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 27 Feb 2014 13:29:38 +0100 Subject: [PATCH] [FIX]project: chosend beginning stage for new project_issue sequence <= 1 (instead of =, same behavior than in tasks) bzr revid: dle@openerp.com-20140227122938-i0s6dfxd42pl6ov3 --- addons/project_issue/project_issue.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index f787ed1544e..6f072f5abd1 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -48,8 +48,9 @@ class project_issue(osv.Model): _mail_post_access = 'read' _track = { 'stage_id': { - 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence == 1, - 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence != 1, + # this is only an heuristics; depending on your particular stage configuration it may not match all 'new' stages + 'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence <= 1, + 'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence > 1, }, 'user_id': { 'project_issue.mt_issue_assigned': lambda self, cr, uid, obj, ctx=None: obj.user_id and obj.user_id.id, @@ -74,7 +75,7 @@ class project_issue(osv.Model): def _get_default_stage_id(self, cr, uid, context=None): """ Gives default stage_id """ project_id = self._get_default_project_id(cr, uid, context=context) - return self.stage_find(cr, uid, [], project_id, [('sequence', '=', 1)], context=context) + return self.stage_find(cr, uid, [], project_id, [('fold', '=', False)], context=context) def _resolve_project_id_from_context(self, cr, uid, context=None): """ Returns ID of project based on the value of 'default_project_id'