state labor cost entry

conv_bal
watcha.h@almacom.co.th 2015-01-23 12:23:54 +07:00
parent 9847749319
commit d84c9ca9f8
5 changed files with 15 additions and 20 deletions

View File

@ -1,8 +0,0 @@
<action>
<field name="string">Doctors</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.doctor</field>
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Temporaly",[["type","=","temporary"]]],["Permanent",[["type","=","permanent"]]]]</field>
<field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -1,8 +0,0 @@
<action>
<field name="string">Nurses</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.nurse</field>
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Temporaly",[["type","=","temporary"]]],["Permanent",[["type","=","permanent"]]]]</field>
<field name="modes">list,page,form</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -3,7 +3,7 @@
<field name="state"/> <field name="state"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<!--<item string="Create Journal Entry"/>--> <!--<item string="Create Journal Entry"/>-->
<item string="TODO"/> <item string="To Draft" method="to_draft" states="approved"/>
</button> </button>
</head> </head>
<group form_layout="stacked"> <group form_layout="stacked">
@ -44,7 +44,7 @@
<tab string="Approval"> <tab string="Approval">
<group form_layout="stacked"> <group form_layout="stacked">
<field name="user_id" span="3"/> <field name="user_id" span="3"/>
<button string="Approve" icon="ok" size="small"/> <button string="Approve" icon="ok" size="small" method="approve" states="draft"/>
</group> </group>
</tab> </tab>
<tab string="Note"> <tab string="Note">

View File

@ -4,7 +4,7 @@ class HDCaseDialyzerLine(Model):
_name="clinic.hd.case.dialyzer" _name="clinic.hd.case.dialyzer"
_fields={ _fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HdCase",on_delete="cascade"), "hd_case_id": fields.Many2One("clinic.hd.case","HdCase",on_delete="cascade"),
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Dialyzer Type"), "dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Type"),
"dialyzer_id": fields.Many2One("clinic.dialyzer","Dialyzer",search=True), "dialyzer_id": fields.Many2One("clinic.dialyzer","Dialyzer",search=True),
"description": fields.Char("Description",search=True), "description": fields.Char("Description",search=True),
"use_time":fields.Integer("Use time"), "use_time":fields.Integer("Use time"),

View File

@ -55,7 +55,6 @@ class LaborCostEntry(Model):
'company_id': fields.Many2One("company","Company"), 'company_id': fields.Many2One("company","Company"),
'department_id': fields.Many2One("clinic.department","Department",search=True), 'department_id': fields.Many2One("clinic.department","Department",search=True),
'branch_id': fields.Many2One("clinic.branch","Branch",search=True), 'branch_id': fields.Many2One("clinic.branch","Branch",search=True),
"state": fields.Selection([["part_time","Part Time"],["full_time","Full Time"]],"Working Status",search=True),
} }
def _get_date_from(self,context={}): def _get_date_from(self,context={}):
@ -193,4 +192,16 @@ class LaborCostEntry(Model):
data['department_id']=None data['department_id']=None
return data return data
def approve(self,ids,context={}):
for obj in self.browse(ids):
obj.write({
'state': 'approved',
})
def to_draft(self,ids,context={}):
for obj in self.browse(ids):
obj.write({
'state': 'draft',
})
LaborCostEntry.register() LaborCostEntry.register()