Added demo data in long term and wizard to assign sprint on backlog
bzr revid: hda@tinyerp.com-20100226134256-p1ussmgt8llq566z
This commit is contained in:
committed by
HDA (OpenERP)
parent
3f969c76a6
commit
9f2cbf6bf9
@@ -30,8 +30,7 @@
|
||||
"description": """Long Term Project management module that track planning, scheduling, resources allocation.
|
||||
""",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [#"project_demo.xml"
|
||||
],
|
||||
"demo_xml" : ["project_demo.xml"],
|
||||
"update_xml": [
|
||||
"project_wizard.xml" ,
|
||||
"project_view.xml",
|
||||
|
||||
@@ -174,7 +174,8 @@ class project_phase(osv.osv):
|
||||
|
||||
if phase.responsible_id.id:
|
||||
resource_id = resource_pool.search(cr,uid,[('user_id','=',phase.responsible_id.id)])
|
||||
calendar_id = resource_pool.browse(cr,uid,resource_id[0]).calendar_id.id
|
||||
if resource_id:
|
||||
calendar_id = resource_pool.browse(cr,uid,resource_id[0]).calendar_id.id
|
||||
default_uom_id = uom_pool.search(cr,uid,[('name','=','Hour')])[0]
|
||||
avg_hours = uom_pool._compute_qty(cr, uid, phase.product_uom.id, phase.duration,default_uom_id)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- <wizard id="wizard_close_task" menu="False" model="project.task" name="project.task.close" string="Close Task"/>
|
||||
<wizard id="wizard_delegate_task" menu="False" model="project.task" name="project.task.delegate" string="Delegate Task"/>
|
||||
<wizard id="wizard_attachment_task" model="project.task" name="project.task.attachment" string="All Attachments"/> -->
|
||||
<wizard id="wizard_compute_phase" menu="False" model="project.phase" name="wizard.compute.phases" string="Compute Phase Scheduling"/>
|
||||
<!--<menuitem icon="terp-project" id="menu_main" name="Project Management"/>-->
|
||||
<wizard id="wizard_schedule_task" menu="False" model="project.phase" name="phase.schedule.tasks" string="Schedule Tasks"/>
|
||||
<menuitem id="base.menu_pm_planning" name="Planning" parent="base.menu_main" sequence="3"/>
|
||||
<menuitem
|
||||
|
||||
@@ -204,6 +204,7 @@ class scrum_product_backlog(osv.osv):
|
||||
scrum_product_backlog()
|
||||
|
||||
class scrum_task(osv.osv):
|
||||
_name = 'project.task'
|
||||
_inherit = 'project.task'
|
||||
_columns = {
|
||||
'product_backlog_id': fields.many2one('scrum.product.backlog', 'Product Backlog'),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<wizard id="wizard_scrum_backlog_task" model="scrum.product.backlog" name="scrum.product.backlog.task.create" string="Convert to Tasks"/>
|
||||
<wizard id="wizard_scrum_backlog_task" model="scrum.product.backlog" name="scrum.product.backlog.task.create" string="Created tasks"/>
|
||||
<wizard id="wizard_scrum_backlog_sprint" model="scrum.product.backlog" name="scrum.product.backlog.sprint.assign" string="Assign Sprint"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
import backlog_to_task
|
||||
import assign_backlog_to_sprint
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import ir
|
||||
from mx.DateTime import now
|
||||
import pooler
|
||||
import netsvc
|
||||
|
||||
bts_form = """<?xml version="1.0" ?>
|
||||
<form string="Assign Sprint">
|
||||
<group>
|
||||
<field name="sprint_id" colspan="2"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator colspan="2"/>
|
||||
<newline/>
|
||||
<group>
|
||||
<field name="state_open" colspan="1"/>
|
||||
<field name="convert_to_task" colspan="1"/>
|
||||
</group>
|
||||
</form>"""
|
||||
|
||||
bts_fields = {
|
||||
'sprint_id' : {'string':'Sprint Name', 'type':'many2one', 'relation':'scrum.sprint', 'required':True},
|
||||
'state_open' : {'string':'Set Open', 'type':'boolean'},
|
||||
'convert_to_task' : {'string':'Convert To Task', 'type':'boolean'}
|
||||
}
|
||||
|
||||
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']
|
||||
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']})
|
||||
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
|
||||
})
|
||||
if state_open:
|
||||
if backlog.state == "draft":
|
||||
backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
|
||||
return {}
|
||||
|
||||
class wiz_bts(wizard.interface):
|
||||
states = {
|
||||
'init':{
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':bts_form, 'fields':bts_fields, 'state':[('end', 'Cancel'), ('assign', 'Assign Sprint')] },
|
||||
},
|
||||
'assign':{
|
||||
'actions': [],
|
||||
'result': {'type':'action', 'action': _assign_sprint, 'state':'end'},
|
||||
},
|
||||
}
|
||||
wiz_bts('scrum.product.backlog.sprint.assign')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user