[IMP] project_scrum :Improvement in OSV wiz , Read method converted to browse
bzr revid: aag@tinyerp.co.in-20110215110054-hrd1eo3z5x3d7lo3
This commit is contained in:
@@ -41,13 +41,10 @@ class backlog_sprint_assign(osv.osv_memory):
|
||||
backlog_ids = []
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.read(cr, uid, ids, [], context=context)[0]
|
||||
if isinstance(data['sprint_id'], tuple):
|
||||
data['sprint_id'] = data['sprint_id'][0]
|
||||
|
||||
data = self.browse(cr, uid, ids,context=context)[0]
|
||||
for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
|
||||
backlog_ids.append(backlog.id)
|
||||
if data['convert_to_task']:
|
||||
if data.convert_to_task:
|
||||
task_id = task.create(cr, uid, {
|
||||
'product_backlog_id': backlog.id,
|
||||
'name': backlog.name,
|
||||
@@ -59,12 +56,12 @@ class backlog_sprint_assign(osv.osv_memory):
|
||||
})
|
||||
message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is converted into Task %d."%(task_id,))
|
||||
self.log(cr, uid, backlog.id, message)
|
||||
if data['state_open'] and backlog.state == "draft":
|
||||
if data.state_open and backlog.state == "draft":
|
||||
backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
|
||||
sprint = sprint_obj.browse(cr, uid, data['sprint_id'], context=context)
|
||||
sprint = sprint_obj.browse(cr, uid, data.sprint_id.id, context=context)
|
||||
message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is assigned sprint:%s"%(sprint.name))
|
||||
self.log(cr, uid, backlog.id, message)
|
||||
backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context)
|
||||
backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data.sprint_id.id}, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
backlog_sprint_assign()
|
||||
|
||||
Reference in New Issue
Block a user