[FIX] project: don't copy remaining hours when duplicating tasks
Since we're not duplicating work items when duplicating tasks during project duplication, it doesn't make sense to duplicate the likely correspondingly adjusted remaining hour. Behave as if the planned hours had just been set/reset and set the remaining hours of the new task to that instead. fixes #8985
This commit is contained in:
@@ -698,9 +698,12 @@ class task(osv.osv):
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
current = self.browse(cr, uid, id, context=context)
|
||||
if not default.get('name'):
|
||||
current = self.browse(cr, uid, id, context=context)
|
||||
default['name'] = _("%s (copy)") % current.name
|
||||
if 'remaining_hours' not in default:
|
||||
default['remaining_hours'] = current.planned_hours
|
||||
|
||||
return super(task, self).copy_data(cr, uid, id, default, context)
|
||||
|
||||
def _is_template(self, cr, uid, ids, field_name, arg, context=None):
|
||||
|
||||
Reference in New Issue
Block a user