[IMP] project_scrum : improved postpone wizard
bzr revid: jas@tinyerp.com-20101007092429-lfqizg17626ezu3m
This commit is contained in:
parent
2780c63d48
commit
3c9671dc67
|
@ -236,6 +236,23 @@ class project_scrum_product_backlog(osv.osv):
|
|||
self.write(cr, uid, ids, {'state':'pending'}, context=context)
|
||||
return True
|
||||
|
||||
def button_postpone(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
for product in self.browse(cr, uid, ids, context=context):
|
||||
tasks_id = []
|
||||
for task in product.tasks_id:
|
||||
if task.state != 'done':
|
||||
tasks_id.append(task.id)
|
||||
|
||||
clone_id = self.copy(cr, uid, product.id, {
|
||||
'name': 'PARTIAL:'+ product.name ,
|
||||
'sprint_id':False,
|
||||
'tasks_id':[(6, 0, tasks_id)],
|
||||
})
|
||||
self.write(cr, uid, ids, {'state':'cancel'}, context=context)
|
||||
return True
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Feature', size=64, required=True),
|
||||
'note' : fields.text('Note'),
|
||||
|
|
|
@ -4,19 +4,6 @@ from osv import fields
|
|||
class postpone_wizard(osv.osv_memory):
|
||||
_name="postpone.wizard"
|
||||
def button_postpone(self, cr, uid, ids, context=None):
|
||||
log_obj=self.pool.get('project.scrum.product.backlog')
|
||||
if context is None:
|
||||
context = {}
|
||||
for product in log_obj.browse(cr, uid, ids, context=context):
|
||||
tasks_id = []
|
||||
for task in product.tasks_id:
|
||||
if task.state != 'done':
|
||||
tasks_id.append(task.id)
|
||||
clone_id = log_obj.copy(cr, uid, product.id, {
|
||||
'name': 'PARTIAL:'+ product.name ,
|
||||
'sprint_id':False,
|
||||
'tasks_id':[(6, 0, tasks_id)],
|
||||
})
|
||||
log_obj.write(cr, uid, ids, {'state':'cancel'}, context=context)
|
||||
return {}
|
||||
self.pool.get('project.scrum.product.backlog').button_postpone(cr, uid, ids, context)
|
||||
return {}
|
||||
postpone_wizard()
|
Loading…
Reference in New Issue