[FIX]project:when try to duplicate task or project than the state of task is not set to default

bzr revid: pna@tinyerp.com-20130319060954-dhk9vgtkpnayt1cv
This commit is contained in:
Pinakin Nayi (OpenERP) 2013-03-19 11:39:54 +05:30
parent 2bfbe50079
commit b20b9aa198
1 changed files with 11 additions and 0 deletions

View File

@ -709,6 +709,17 @@ class task(base_stage, osv.osv):
new_name = _("%s (copy)") % (default.get('name', ''))
default.update({'name':new_name})
return super(task, self).copy_data(cr, uid, id, default, context)
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
if default is None:
default = {}
stage = self._get_default_stage_id(cr, uid, context=context)
if stage :
default['stage_id'] = stage
res = super(task, self).copy(cr, uid, id, default, context)
return res
def _is_template(self, cr, uid, ids, field_name, arg, context=None):
res = {}