summaryrefslogtreecommitdiff
path: root/addons/project_issue/project_issue.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2015-11-23 16:31:40 +0100
committerThibault Delavallée <tde@openerp.com>2015-11-23 17:36:40 +0100
commit8fa73181781babbf09ab655ba13ae81ce4ec7064 (patch)
tree2d827fde1c4d3bbb0cdb4765578b7398c3633489 /addons/project_issue/project_issue.py
parentaf6305722fd3a67be43547c3a759a3584d898d1f (diff)
[FIX] project, issue: change user_id + date_start
project.task: use an onchange to update date_start when changing user_id. Indeed date_start is automatically updated in the create / write. Without the onchange, this may lead to errors related to date_start being greater then date_end. project.issue: code in create and write now takes into account date_open values given to the method and avoid erasing them. In issue however the onchange is not added. Indeed the date_open and date_closed fields are not visible in the view. They are automatically computed and used to compute statistics.
Diffstat (limited to 'addons/project_issue/project_issue.py')
-rw-r--r--addons/project_issue/project_issue.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 8914f1ebda2..a20343590e4 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -303,7 +303,7 @@ class project_issue(osv.Model):
context = dict(context or {})
if vals.get('project_id') and not context.get('default_project_id'):
context['default_project_id'] = vals.get('project_id')
- if vals.get('user_id'):
+ if vals.get('user_id') and not vals.get('date_open'):
vals['date_open'] = fields.datetime.now()
if 'stage_id' in vals:
vals.update(self.onchange_stage_id(cr, uid, None, vals.get('stage_id'), context=context)['value'])
@@ -319,8 +319,8 @@ class project_issue(osv.Model):
vals['date_last_stage_update'] = fields.datetime.now()
if 'kanban_state' not in vals:
vals['kanban_state'] = 'normal'
- # user_id change: update date_start
- if vals.get('user_id'):
+ # user_id change: update date_open
+ if vals.get('user_id') and 'date_open' not in vals:
vals['date_open'] = fields.datetime.now()
return super(project_issue, self).write(cr, uid, ids, vals, context)