# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
def _assign_sprint(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
backlog_obj = pool.get('scrum.product.backlog')
- task = pool.get('project.task')
-
- state_open=data['form']['state_open']
+ task = pool.get('project.task')
+ state_open = data['form']['state_open']
convert_to_task = data['form']['convert_to_task']
-
- for backlog in backlog_obj.browse(cr, uid, data['ids']):
- backlog_obj.write(cr, uid, backlog.id, {'sprint_id':data['form']['sprint_id']})
+ for backlog in backlog_obj.browse(cr, uid, data['ids'], context=context):
+ backlog_obj.write(cr, uid, backlog.id, {'sprint_id':data['form']['sprint_id']}, context=context)
if convert_to_task:
task.create(cr, uid, {
'product_backlog_id': backlog.id,
'name': backlog.name,
'description': backlog.note,
'project_id': backlog.project_id.id,
- 'user_id': (backlog.user_id and backlog.user_id.id) or uid,
- 'planned_hours': backlog.planned_hours
+ 'user_id': False,
+ 'planned_hours':backlog.planned_hours,
+ 'remaining_hours':backlog.expected_hours,
})
if state_open:
if backlog.state == "draft":
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
'user_id' : {'string':'Assign To', 'type':'many2one', 'relation':'res.users'},
}
-def _do_create(self, cr, uid, data, context):
+def _do_create(self, cr, uid, data, context={}):
pool = pooler.get_pool(cr.dbname)
- backlogs = pool.get('scrum.product.backlog').browse(cr, uid, data['ids'])
- mod_obj = pool.get('ir.model.data')
+ backlogs = pool.get('scrum.product.backlog').browse(cr, uid, data['ids'], context=context)
+ mod_obj = pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
id = mod_obj.read(cr, uid, result, ['res_id'])
ids = []
'name': backlog.name,
'description': backlog.note,
'project_id': backlog.project_id.id,
- 'user_id': data['form']['user_id'] or (backlog.user_id and backlog.user_id.id) or uid,
- 'planned_hours': backlog.planned_hours
+ 'user_id': data['form']['user_id'] or False,
+ 'planned_hours': backlog.planned_hours,
+ 'remaining_hours':backlog.expected_hours,
}))
-
value = {
'domain': "[('product_backlog_id','in',["+','.join(map(str,data['ids']))+"])]",
'name': 'Open Backlog Tasks',
'res_model': 'project.task',
'view_id': False,
'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
+ 'search_view_id': id['res_id'],
}
return value