Skip to content
Snippets Groups Projects
Commit 48f370c6 authored by Simon Lejeune's avatar Simon Lejeune
Browse files

[FIX] project_issue: default stage on issue

If you create an issue directly, the key `default_project_id` is not set
in the context. This key is used to compute the default stage of the
created issue. It is done by creating a domain. Unfortunately, the
domain is always filled with `[('fold', '=', False)]` and thus it
always returns a result that makes no sense when `default_project_id`
is not set. Worse, if you actually create the issue, the found stage
that was not in your project is now a part of it.

The fix is to return no result if the `default_project_id` is not set
in the context.
parent 3041efb6
Branches
Tags
No related merge requests found
......@@ -36,7 +36,10 @@ class project_issue(osv.Model):
""" Gives default stage_id """
if context is None:
context = {}
return self.stage_find(cr, uid, [], context.get('default_project_id'), [('fold', '=', False)], context=context)
default_project_id = context.get('default_project_id')
if not default_project_id:
return False
return self.stage_find(cr, uid, [], default_project_id, [('fold', '=', False)], context=context)
def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
if context is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment