report medicine to pdf

This commit is contained in:
XuanHuyen
2025-03-22 11:08:34 +07:00
parent 662726af4e
commit d08f3cb726
2 changed files with 48 additions and 0 deletions
+1
View File
@@ -25,6 +25,7 @@
'views/clinic_prescription_views.xml',
'views/clinic_prescription_line_views.xml',
'views/clinic_service_views.xml',
'reports/clinic_medicine_report.xml',
'views/clinic_menus.xml',
],
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_clinic_medicine_template">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page">
<table>
<thead>
<tr>
<th>Tên thuốc</th>
<th>Số lượng còn trong kho</th>
<th>Giá</th>
</tr>
</thead>
<tbody>
<tr t-foreach="docs" t-as="medicine"
t-att-style="medicine.stock &lt; 10 and 'color: red;' or ''">
<td style="width: 30%">
<t t-esc="medicine.name" />
</td>
<td style="width: 30%">
<t t-esc="medicine.stock" />
</td>
<td style="width: 30%">
<t t-esc="medicine.price" />
</td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</template>
<record id="report_clinic_medicine" model="ir.actions.report">
<field name="name">Báo cáo số lượng thuốc</field>
<field name="model">clinic.medicine</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">clinic_management.report_clinic_medicine_template</field>
<field name="report_file">clinic_management.report_clinic_medicine_template</field>
<field name="binding_model_id" ref="clinic_management.model_clinic_medicine" />
<field name="binding_type">report</field>
<field name="binding_view_types">list</field>
</record>
</odoo>