[IMP]project_scrum : Added state and buttons on top bar

bzr revid: mma@tinyerp.com-20120503122239-6feyr2lnsu4gythv
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-05-03 17:52:39 +05:30
parent 70c7252b2c
commit a7bd8efb9f
2 changed files with 32 additions and 24 deletions

View File

@ -109,7 +109,7 @@ class project_scrum_sprint(osv.osv):
'progress': fields.function(_compute, group_operator="avg", type='float', multi="progress", string='Progress (0-100)', help="Computed as: Time Spent / Total Time."),
'effective_hours': fields.function(_compute, multi="effective_hours", string='Effective hours', help="Computed using the sum of the task work done."),
'expected_hours': fields.function(_compute, multi="expected_hours", string='Planned Hours', help='Estimated time to do the task.'),
'state': fields.selection([('draft','Draft'),('cancel','Cancelled'),('open','Open'),('pending','Pending'),('done','Done')], 'State', required=True),
'state': fields.selection([('draft','Draft'),('pending','Pending'),('open','Open'),('done','Done'),('cancel','Cancelled')], 'State', required=True),
}
_defaults = {
'state': 'draft',
@ -229,7 +229,7 @@ class project_scrum_product_backlog(osv.osv):
'sprint_id': fields.many2one('project.scrum.sprint', 'Sprint'),
'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of product backlog."),
'tasks_id': fields.one2many('project.task', 'product_backlog_id', 'Tasks Details'),
'state': fields.selection([('draft','Draft'),('open','Open'),('pending','Pending'),('done','Done'),('cancel','Cancelled')], 'State', required=True),
'state': fields.selection([('draft','Draft'),('pending','Pending'),('open','Open'),('done','Done'),('cancel','Cancelled')], 'State', required=True),
'progress': fields.function(_compute, multi="progress", group_operator="avg", type='float', string='Progress', help="Computed as: Time Spent / Total Time."),
'effective_hours': fields.function(_compute, multi="effective_hours", string='Spent Hours', help="Computed using the sum of the time spent on every related tasks", store=True),
'expected_hours': fields.float('Planned Hours', help='Estimated total time to do the Backlog'),

View File

@ -56,8 +56,20 @@
<field name="model">project.scrum.product.backlog</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product backlog">
<group colspan="4" col="8">
<form layout="manual">
<div class="oe_form_topbar">
<button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
<button type="object" string="Cancel" name="button_cancel" states="draft,open,pending" icon="gtk-stop"/>
<div class="oe_right">
<field name="state" select="1" widget="statusbar" nolabel="1" statusbar_visible="draft,open"/>
</div>
</div>
<sheet string="Product backlog" layout="auto">
<group colspan="4" col="8" class="oe_form_header">
<field name="name" select="1"/>
<field name="project_id" select="1"/>
<field domain="[('project_id','=',project_id), ('state','in', ['draft','open'])]" name="sprint_id" select="1"/>
@ -109,15 +121,7 @@
</field>
</page>
</notebook>
<group col="8" colspan="4">
<field name="state" select="1" readonly="1"/>
<button type="object" string="Cancel" name="button_cancel" states="draft,open,pending" icon="gtk-stop"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
<button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
</group>
</sheet>
</form>
</field>
</record>
@ -232,8 +236,20 @@
<field name="model">project.scrum.sprint</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Scrum Sprint">
<group colspan="4" col="6">
<form layout="manual">
<div class="oe_form_topbar">
<button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button name="%(project_scrum.report_scrum_sprint_burndown_chart)d"
string="Burndown Chart" type="action" icon="gtk-print"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
<div class="oe_right">
<field name="state" readonly="1" widget="statusbar" nolabel="1" statusbar_visible="draft,open"/>
</div>
</div>
<sheet string="Scrum Sprint" layout="auto">
<group colspan="4" col="6" class="oe_form_header">
<field name="name" select="1"/>
<field name="project_id" on_change="onchange_project_id(project_id)"/>
</group>
@ -298,15 +314,7 @@
<field colspan="4" name="retrospective" nolabel="1"/>
</page>
</notebook>
<group col="8" colspan="4">
<field name="state" readonly="1"/>
<button name="%(project_scrum.report_scrum_sprint_burndown_chart)d"
string="Burndown Chart" type="action" icon="gtk-print"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
</group>
</sheet>
</form>
</field>
</record>