improve print labor cost

conv_bal
watcha.h 2015-07-30 11:02:52 +07:00
parent 43a30a45ab
commit 08cf135863
2 changed files with 10 additions and 13 deletions

View File

@ -7,25 +7,19 @@
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="2"/>
<field name="cycle_id" span="2"/>
<field name="staff_type" required="1" span="2"/>
<!--<field name="staff_id" span="2" domain='[["type","=",staff_type]]'/>-->
<button string="Generate Report" method="do_generate" icon="arrow-right" type="default"/>
<field name="report_summary" span="3" readonly="1"/>
<field name="report_labor_cost" span="3" readonly="1"/>
<field name="report_summary" span="3" readonly="1"/>
<field name="lines" nolabel="1" readonly="1">
<list>
<!--<field name="staff_id" domain='[["type","=",parent.staff_type]]'/>-->
<field name="staff_name" readonly="1"/>
<!--<field name="report_summary" readonly="1"/>-->
<field name="report_detail" readonly="1"/>
<field name="report_sub_detail" readonly="1"/>
<field name="report_daily" readonly="1"/>
<field name="report_ot" readonly="1"/>
<!--<field name="total_qty" readonly="1"/>-->
<!--<field name="total_amount" readonly="1"/>-->
<!--<field name="report_daily" readonly="1"/>-->
<!--<field name="report_ot" readonly="1"/>-->
</list>
</field>
</group>
<foot replace="1">
<!--<button string="Print" method="do_print" icon="print" type="default"/>-->
</foot>
</form>

View File

@ -81,9 +81,12 @@ class PrintLaborCost(Model):
Please wait until report is generated.
""",
}
db=get_connection()
get_model("message").create(vals)
db.commit()
return {
'next': {
'type': 'reload',
}
}
def generate_report(self,ids,context={}):
obj=self.browse(ids)[0]
@ -179,8 +182,8 @@ class PrintLaborCost(Model):
report_lines=[
{'report_file': 'report_detail','model': 'clinic.report.labor.cost.detail', 'report_id': obj.dt_report_id.id,'field_name': 'dt_report_id'},
{'report_file': 'report_sub_detail','model': 'clinic.report.labor.cost.sub.detail', 'report_id': obj.sub_dt_report_id.id,'field_name': 'sub_dt_report_id'},
{'report_file': 'report_daily','model': 'clinic.report.labor.cost.daily', 'report_id': obj.dl_report_id.id,'field_name': 'dl_report_id'},
{'report_file': 'report_ot','model': 'clinic.report.labor.cost.overtime', 'report_id': obj.ot_report_id.id,'field_name': 'ot_report_id'},
#{'report_file': 'report_daily','model': 'clinic.report.labor.cost.daily', 'report_id': obj.dl_report_id.id,'field_name': 'dl_report_id'},
#{'report_file': 'report_ot','model': 'clinic.report.labor.cost.overtime', 'report_id': obj.ot_report_id.id,'field_name': 'ot_report_id'},
]
for line in obj.lines:
staff=line.staff_id