[MERGE] project_scrum: modify view, and add tests
bzr revid: rco@openerp.com-20111129150342-ljvnzuaajv25s5hw
This commit is contained in:
@@ -65,7 +65,11 @@ More information on the methodology:
|
||||
"board_project_scrum_view.xml",
|
||||
],
|
||||
'demo_xml': ['project_scrum_demo.xml'],
|
||||
'test': ['test/project_scrum_report.yml'],
|
||||
'test': ['test/backlog_process.yml',
|
||||
'test/sprint_process.yml',
|
||||
'test/cancel_backlog.yml',
|
||||
'test/project_scrum_demo.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate' : '00736750152003010781',
|
||||
|
||||
@@ -262,7 +262,7 @@ class project_scrum_task(osv.osv):
|
||||
'project.scrum.product.backlog': (_get_task, ['sprint_id'], 10)
|
||||
}),
|
||||
}
|
||||
|
||||
#dead code
|
||||
def onchange_backlog_id(self, cr, uid, backlog_id=False):
|
||||
if not backlog_id:
|
||||
return {}
|
||||
@@ -292,7 +292,7 @@ class project_scrum_meeting(osv.osv):
|
||||
_defaults = {
|
||||
'date' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
# dead code
|
||||
def button_send_to_master(self, cr, uid, ids, context=None):
|
||||
meeting_id = self.browse(cr, uid, ids, context=context)[0]
|
||||
if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email:
|
||||
@@ -303,6 +303,7 @@ class project_scrum_meeting(osv.osv):
|
||||
raise osv.except_osv(_('Error !'), _('Please provide email address for scrum master defined on sprint.'))
|
||||
return True
|
||||
|
||||
#dead code
|
||||
def button_send_product_owner(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -316,6 +317,7 @@ class project_scrum_meeting(osv.osv):
|
||||
raise osv.except_osv(_('Error !'), _('Please provide email address for product owner defined on sprint.'))
|
||||
return True
|
||||
|
||||
#dead code
|
||||
def email_send(self, cr, uid, ids, email, context=None):
|
||||
mail_message_obj = self.pool.get('mail.message')
|
||||
meeting_id = self.browse(cr, uid, ids, context=context)[0]
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<field name="project_id" ref="project.project_project_9"/>
|
||||
<field name="product_owner_id" ref="base.user_root"/>
|
||||
<field model="res.users" name="scrum_master_id" search="[('login','=','admin')]"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
||||
<record id="scrum_sprint_1" model="project.scrum.sprint">
|
||||
@@ -158,7 +157,6 @@
|
||||
<field name="expected_hours">6.0</field>
|
||||
<field name="note">This new system will enable you to migrate automatically from an old version of OpenERP to a new one. This system will migrate not only the OpenERP system but also the customers particularities. This happens without any kind of script or programming. It has been possible to carry out such a system thanks to the descriptive approach of OpenERP components. </field>
|
||||
<field name="sprint_id" ref="scrum_sprint_0"/>
|
||||
<field name="state">done</field>
|
||||
<field name="project_id" ref="project.project_project_9"/>
|
||||
</record>
|
||||
<record id="scrum_product_backlog_1" model="project.scrum.product.backlog">
|
||||
@@ -387,6 +385,9 @@
|
||||
<field name="state">open</field>
|
||||
<field name="product_backlog_id" ref="scrum_product_backlog_7"/>
|
||||
</record>
|
||||
|
||||
<!-- Resource: project_scrum.meeting -->
|
||||
|
||||
<record id="scrum_meeting_0" model="project.scrum.meeting">
|
||||
<field name="question_yesterday">
|
||||
Admin: Worked on the Automatic migration system
|
||||
|
||||
@@ -263,6 +263,8 @@
|
||||
<group colspan="4" col="6">
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<button name="%(mail.action_email_compose_message_wizard)d"
|
||||
string="Send Email" type="action" icon="terp-mail-message-new"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Scrum Meeting">
|
||||
@@ -273,8 +275,6 @@
|
||||
<separator colspan="4" string="Are there anything blocking you?"/>
|
||||
<field colspan="4" name="question_blocks" nolabel="1"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<button name="button_send_to_master" type="object" string="Send to Scrum Master" icon="gtk-ok"/>
|
||||
<button name="button_send_product_owner" type="object" string="Send to Product Owner" icon="gtk-ok"/>
|
||||
</page>
|
||||
<page string="Optional Info">
|
||||
<separator colspan="4" string="Are your Sprint Backlog estimate accurate ?"/>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
-
|
||||
In Order to Test process of Project Agile Methology,
|
||||
-
|
||||
I put Backlog in pending state because of specification is not ready.
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_pending(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after put in pending.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: Backlog should be in pending state}:
|
||||
- state == "pending"
|
||||
-
|
||||
Now Specification is ready so I Open backlog "Automatic migration system".
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_open(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after opened.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: Backlog should be in open state}:
|
||||
- state == "open"
|
||||
-
|
||||
I close Backlog after review.
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_close(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after closed.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: Backlog should be in close state}:
|
||||
- state == "done"
|
||||
-
|
||||
I merge two Backlogs in to one Backlog.
|
||||
-
|
||||
!python {model: project.scrum.backlog.merge}: |
|
||||
self.check_backlogs(cr, uid, [ref("scrum_product_backlog_1"),ref("scrum_product_backlog_2")], {"active_ids": [ref("scrum_product_backlog_1"),ref("scrum_product_backlog_2")],
|
||||
"active_id": ref("scrum_product_backlog_1")
|
||||
})
|
||||
@@ -0,0 +1,50 @@
|
||||
-
|
||||
I cancel Backlog "Automatic migration system" from draft state.
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_cancel(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after canceled.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: backlog should be in cancel state}:
|
||||
- state == "cancel"
|
||||
-
|
||||
I cancel opened Backlog "Editable Trees".
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_cancel(cr, uid, [ref("scrum_product_backlog_7")])
|
||||
-
|
||||
I check state of Backlog after canceled.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_7, severity: error, string: backlog should be in cancel state}:
|
||||
- state == "cancel"
|
||||
-
|
||||
I put Backlog in pending due to resource unavailability.
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_pending(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after put in pending.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: Backlog should be in pending state}:
|
||||
- state == "pending"
|
||||
-
|
||||
I cancel pending Backlog "Automatic migration system".
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_cancel(cr, uid, [ref("scrum_product_backlog_0")])
|
||||
-
|
||||
I check state of Backlog after canceled.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_0, severity: error, string: backlog should be in cancel state}:
|
||||
- state == "cancel"
|
||||
-
|
||||
I Postpone opened Backlog "Reshape the complete menu".
|
||||
-
|
||||
!python {model: project.scrum.product.backlog}: |
|
||||
self.button_postpone(cr, uid, [ref("scrum_product_backlog_6")])
|
||||
-
|
||||
I check state of Backlog after Postpone.
|
||||
-
|
||||
!assert {model: project.scrum.product.backlog, id: scrum_product_backlog_6, severity: error, string: backlog should be in cancel state}:
|
||||
- state == "cancel"
|
||||
@@ -0,0 +1,3 @@
|
||||
-
|
||||
!record {model: project.scrum.sprint, id: scrum_sprint_0, view: False}:
|
||||
project_id: project.project_integrate_openerp
|
||||
@@ -1,9 +0,0 @@
|
||||
-
|
||||
In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report
|
||||
-
|
||||
!python {model: project.scrum.sprint}: |
|
||||
import netsvc, tools, os
|
||||
data_dict = {'model': 'project.scrum.sprint', 'id':ref('project_scrum.scrum_sprint_0')}
|
||||
(data, format) = netsvc.LocalService('report.scrum.sprint.burndown').create(cr, uid, [ref('project_scrum.scrum_sprint_0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data)
|
||||
@@ -0,0 +1,78 @@
|
||||
-
|
||||
I put sprint in pending state to allocate task to resources.
|
||||
-
|
||||
!python {model: project.scrum.sprint}: |
|
||||
self.button_pending(cr, uid, [ref("scrum_sprint_0")])
|
||||
-
|
||||
I check state of sprint after put in pending.
|
||||
-
|
||||
!assert {model: project.scrum.sprint, id: scrum_sprint_0, severity: error, string: Sprint should be in pending state}:
|
||||
- state == "pending"
|
||||
-
|
||||
I assign Backlog into this Sprint
|
||||
-
|
||||
!python {model: project.scrum.backlog.assign.sprint}: |
|
||||
new_id = self.create(cr, uid, {'sprint_id': ref("scrum_sprint_0")})
|
||||
self.assign_sprint(cr, uid, [new_id], {"active_ids": [ref("scrum_product_backlog_0")]
|
||||
})
|
||||
backlog_obj = self.pool.get('project.scrum.product.backlog')
|
||||
task_obj = self.pool.get('project.task')
|
||||
|
||||
backlog_data = backlog_obj.browse(cr, uid, ref("scrum_product_backlog_0"), context)
|
||||
assert backlog_data.sprint_id.id == ref("scrum_sprint_0"), 'Sprint is not assigned'
|
||||
-
|
||||
I Open sprint of "Week 31"
|
||||
-
|
||||
!python {model: project.scrum.sprint}: |
|
||||
self.button_open(cr, uid, [ref("scrum_sprint_0")])
|
||||
-
|
||||
I check state of sprint after opened.
|
||||
-
|
||||
!assert {model: project.scrum.sprint, id: scrum_sprint_0, severity: error, string: Sprint should be in Open state}:
|
||||
- state == "open"
|
||||
-
|
||||
I create tasks from backlog "Automatic migration system" for sprint
|
||||
-
|
||||
!python {model: project.scrum.backlog.create.task}: |
|
||||
new_id = self.create(cr, uid, {'user_id': ref("project.res_users_project_manager")})
|
||||
task_obj = self.pool.get('project.task')
|
||||
backlog_obj = self.pool.get('project.scrum.product.backlog')
|
||||
|
||||
new_task = self.do_create(cr, uid, [new_id], {"active_ids": [ref("scrum_product_backlog_0")]})
|
||||
backlog_data = backlog_obj.browse(cr, uid, ref("scrum_product_backlog_0"), context)
|
||||
task_ids = task_obj.search(cr, uid, [('product_backlog_id','=', backlog_data.id)])
|
||||
assert len(task_ids), "Task not created"
|
||||
task = task_obj.browse(cr, uid, task_ids[0], context)
|
||||
|
||||
assert task.name == backlog_data.name and task.total_hours == backlog_data.expected_hours and task.user_id and task.user_id.id == ref("project.res_users_project_manager"), 'Task not has been created'
|
||||
-
|
||||
I send email to scrum master with scrum meeting details.
|
||||
-
|
||||
!python {model: mail.compose.message }: |
|
||||
ctx = context.copy()
|
||||
ctx.update({'active_model': 'project.scrum.meeting', 'active_id': ref("scrum_meeting_0"), 'active_ids': [ref("scrum_meeting_0")]})
|
||||
vals = self.default_get(cr, uid , [], context=ctx)
|
||||
try:
|
||||
new_id = self.create(cr, uid, {'email_to': 'xyz@mycompany.com', 'subject': 'test'})
|
||||
self.send_mail(cr, uid, [new_id], context=ctx)
|
||||
except Exception, e:
|
||||
pass
|
||||
-
|
||||
I close sprint after review
|
||||
-
|
||||
!python {model: project.scrum.sprint}: |
|
||||
self.button_close(cr, uid, [ref("scrum_sprint_0")])
|
||||
-
|
||||
I check state after closed sprint.
|
||||
-
|
||||
!assert {model: project.scrum.sprint, id: scrum_sprint_0, severity: error, string: Sprint shoud be in close state}:
|
||||
- state == "done"
|
||||
-
|
||||
I print Burndown chart of Sprint.
|
||||
-
|
||||
!python {model: project.scrum.sprint}: |
|
||||
import netsvc, tools, os
|
||||
data_dict = {'model': 'project.scrum.sprint', 'id':ref('scrum_sprint_0')}
|
||||
(data, format) = netsvc.LocalService('report.scrum.sprint.burndown').create(cr, uid, [ref('scrum_sprint_0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data)
|
||||
Reference in New Issue
Block a user