report staff

conv_bal
watcha.h 2015-02-02 18:12:00 +07:00
parent 570dde6b52
commit ee59ff0f47
5 changed files with 28 additions and 4 deletions

View File

@ -0,0 +1,6 @@
<action>
<field name="type">report_xls</field>
<field name="model">clinic.report.staff</field>
<field name="method">get_data</field>
<field name="template">report_staff</field>
</action>

View File

@ -1,6 +1,6 @@
<form model="clinic.report.staff">
<head>
<button string="Print" icon="print" action="report_staff_print"/>
<button string="Print" icon="print" action="report_staff"/>
</head>
<group form_layout="stacked">
<field name="entry_id" required="1" span="3"/>

View File

@ -1,7 +1,8 @@
<list model="clinic.shop">
<field name="number"/>
<field name="date"/>
<field name="patient_id"/>
<!--<field name="patient_id"/>-->
<field name="contact_id"/>
<field name="branch_id"/>
<field name="department_id"/>
<field name="user_id"/>

View File

@ -1,4 +1,4 @@
from netforce.model import Model, fields
from netforce.model import Model, fields, get_model
class ReportStaff(Model):
_name='clinic.report.staff'
@ -47,7 +47,24 @@ class ReportStaff(Model):
self.function_store(ids)
def get_data(self,context={}):
data={}
refer_id=int(context.get("refer_id","0"))
obj=get_model('clinic.report.staff').browse(refer_id)
lines=[]
count=0
for line in obj.lines:
patient=line.patient_id
hd_case=line.hd_case_id
lines.append({
'no': count,
})
count+=1
data={
'date_from': obj.date_from,
'date_to': obj.date_to,
'staff_name': obj.staff_id.name or '',
'staff_type': obj.staff_type or '',
'lines': lines,
}
return data
ReportStaff.register()

Binary file not shown.