pending cycle item

conv_bal
watcha.h 2015-03-19 13:43:25 +07:00
parent 1135d7171e
commit 93cba3e688
4 changed files with 18 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.cycle.item</field> <field name="model">clinic.cycle.item</field>
<field name="modes">list,form</field> <field name="modes">list,form</field>
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Validated",[["state","=","validated"]]]]</field> <field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Pending",[["state","=","pending"]]],["Validated",[["state","=","validated"]]]]</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
<field name="limit">25</field> <field name="limit">25</field>
</action> </action>

View File

@ -5,7 +5,7 @@
<item string="Copy Nurses" method="cycle_item_copy" states='draft'/> <item string="Copy Nurses" method="cycle_item_copy" states='draft'/>
<!--<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>--> <!--<item string="Recheck HD Case" method="update_hdcase" states="draft" confirm="Are you sure?"/>-->
<item string="View Schedule" method="view_schedule"/> <item string="View Schedule" method="view_schedule"/>
<item string="To Draft" method="to_draft" states="validated" /> <item string="To Draft" method="to_draft" states="pending,validated" />
</button> </button>
</head> </head>
<group from_layout="stacked"> <group from_layout="stacked">
@ -26,17 +26,20 @@
</field> </field>
</tab> </tab>
<tab string="Validation"> <tab string="Validation">
<field name="user_id" span="4"/>
<button string="Validate" perm="clinic_cycle_item_validate" type="success" method="validate" icon="ok" size="small" states="draft" />
<group span="6" columns="1">
</group>
<group span="6" columns="1"> <group span="6" columns="1">
<field name="user_id" span="6"/>
<button string="Validate" perm="clinic_cycle_item_validate" type="success" method="validate" icon="ok" size="small" states="draft,pending" />
<template> <template>
<div> <div>
<p></p> <p></p>
<b>Note: </b>State Accept: <b style="color:green">'Finish Treatment', 'Waiting Payment', 'Paid'.</b></div> <b>Note: </b>State Accept: <b style="color:green">'Finish Treatment', 'Waiting Payment', 'Paid'.</b></div>
</template> </template>
</group> </group>
<group span="6" columns="1">
<button string="Pending" perm="clinic_cycle_item_validate" type="default" method="pending" icon="pause" size="small" states="draft" />
<newline/>
<field name="note"/>
</group>
</tab> </tab>
</tabs> </tabs>
<related> <related>

View File

@ -9,5 +9,6 @@
<field name="nurse_total"/> <field name="nurse_total"/>
<field name="user_id"/> <field name="user_id"/>
<field name="date_validate"/> <field name="date_validate"/>
<field name="note"/>
<field name="state"/> <field name="state"/>
</list> </list>

View File

@ -46,8 +46,9 @@ class CycleItem(Model):
'branch_id': fields.Many2One("clinic.branch", "Branch",search=True), 'branch_id': fields.Many2One("clinic.branch", "Branch",search=True),
'department_id': fields.Many2One("clinic.department", "Department",search=True), 'department_id': fields.Many2One("clinic.department", "Department",search=True),
"comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"), "comments": fields.One2Many("message","related_id","Comments"), "company_id": fields.Many2One("company","Company"),
"state": fields.Selection([("draft","Draft"),("validated","Validated")],"Status",required=True), "state": fields.Selection([("draft","Draft"),('pending','Pending'),("validated","Validated")],"Status",required=True),
'nurse_total': fields.Integer("Nurses",function="_get_all",function_multi=True), 'nurse_total': fields.Integer("Nurses",function="_get_all",function_multi=True),
'note': fields.Text("Note"),
} }
def _get_branch(self,context={}): def _get_branch(self,context={}):
@ -278,4 +279,10 @@ class CycleItem(Model):
}, },
} }
def pending(self,ids,context={}):
for obj in self.browse(ids):
obj.write({
'state': 'pending',
})
CycleItem.register() CycleItem.register()