diff options
| author | Chris Biersbach <cbi@openerp.com> | 2012-12-28 09:45:27 +0100 |
|---|---|---|
| committer | Chris Biersbach <cbi@openerp.com> | 2012-12-28 09:45:27 +0100 |
| commit | f96f20e4d3f8354176504e420e01a37ebd1035b1 (patch) | |
| tree | 1b8c1246352fd896d4ab062afc4ea95bdbe856f7 /addons/project_issue/project_issue.py | |
| parent | 22808e5a8135ac03819efce30f730a3f7f966c45 (diff) | |
[FIX] The default stage for issues and tasks is now correctly a draft stage of the project the issue or task belongs to.
bzr revid: cbi@openerp.com-20121228084527-ive0ope41di6bpjn
Diffstat (limited to 'addons/project_issue/project_issue.py')
| -rw-r--r-- | addons/project_issue/project_issue.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index fcc6b3d0265..f4d8e828945 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -64,6 +64,13 @@ class project_issue(base_stage, osv.osv): }, } + def create(self, cr, uid, vals, context=None): + if not context.get('default_project_id', False) and vals.get('project_id', False): + ctx = context.copy() + 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) + def _get_default_project_id(self, cr, uid, context=None): """ Gives default project by checking if present in the context """ return self._resolve_project_id_from_context(cr, uid, context=context) |
