diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/hr/report | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/hr/report')
| -rw-r--r-- | addons/hr/report/hr_employee_badge.xml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/addons/hr/report/hr_employee_badge.xml b/addons/hr/report/hr_employee_badge.xml new file mode 100644 index 00000000..3a8fa9fd --- /dev/null +++ b/addons/hr/report/hr_employee_badge.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="hr_employee_print_badge" model="ir.actions.report"> + <field name="name">Print Badge</field> + <field name="model">hr.employee</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">hr.print_employee_badge</field> + <field name="report_file">hr.print_employee_badge</field> + <field name="print_report_name">'Print Badge - %s' % (object.name).replace('/', '')</field> + <field name="binding_model_id" ref="model_hr_employee"/> + <field name="binding_type">report</field> + </record> + + <template id="print_employee_badge"> + <t t-call="web.basic_layout"> + <div class="page"> + <t t-foreach="docs" t-as="employee"> + <div class="col-md-6"> + <table style="width:243pt; height:153pt; border: 1pt solid black; border-collapse:separate; border-radius:8pt; margin:5pt"> + <td style="width:33%;" valign="center"> + <table style="width:77pt; height:150pt"> + <tr style="height:30%"> + <td align="center" valign="center"> + <img t-if="employee.company_id.logo" t-att-src="image_data_uri(employee.company_id.logo)" style="max-height:45pt;max-width:90%" alt="Company Logo"/> + </td> + </tr> + <tr style="height:70%;"> + <td align="center" valign="center"> + <img t-if="employee.image_1920" t-att-src="image_data_uri(employee.image_1920)" style="max-height:85pt;max-width:90%" alt="Employee Image"/> + </td> + </tr> + </table> + </td> + <td style="width:67%" valign="center"> + <table style="width:155pt; height:85pt"> + <tr><th><div style="font-size:15pt; margin-bottom:0pt;margin-top:0pt;" align="center"><t t-esc="employee.name"/></div></th></tr> + <tr><td><div align="center" style="font-size:10pt;margin-bottom:5pt;"><t t-esc="employee.job_id.name"/></div></td></tr> + <tr><td><img alt="barcode" t-if="employee.barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', employee.barcode, 600, 120)" style="max-height:50pt;max-width:100%;" align="center"/></td></tr> + </table> + </td> + </table> + </div> + </t> + </div> + </t> + </template> +</odoo> |
