Skip to content
Permalink
Browse files

[FIX] project: Fill date_last_stage_update when needed

  • Loading branch information...
sswapnesh committed Mar 20, 2019
1 parent f451f90 commit 92160b4a446cbfc2b8ef80748bd478b6600618e8
Showing with 2 additions and 2 deletions.
  1. +2 −2 addons/project/models/project.py
@@ -478,7 +478,6 @@ def _read_group_stage_ids(self, stages, domain, order):
date_assign = fields.Datetime(string='Assigning Date', index=True, copy=False, readonly=True)
date_deadline = fields.Date(string='Deadline', index=True, copy=False, track_visibility='onchange')
date_last_stage_update = fields.Datetime(string='Last Stage Update',
default=fields.Datetime.now,
index=True,
copy=False,
readonly=True)
@@ -696,9 +695,10 @@ def create(self, vals):
# user_id change: update date_assign
if vals.get('user_id'):
vals['date_assign'] = fields.Datetime.now()
# Stage change: Update date_end if folded stage
# Stage change: Update date_end if folded stage and date_last_stage_update
if vals.get('stage_id'):
vals.update(self.update_date_end(vals['stage_id']))
vals['date_last_stage_update'] = fields.Datetime.now()
task = super(Task, self.with_context(context)).create(vals)
return task

0 comments on commit 92160b4

Please sign in to comment.
You can’t perform that action at this time.