From b380347b0b973307aec3f1af93c34bdb27ebd8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= <tde@odoo.com> Date: Fri, 31 Mar 2017 14:50:48 +0200 Subject: [PATCH] [IMP] hr related addons: improve report naming and use print_report_name Purpose of this commit is to clean and uniformize report naming through various addons. It has been chosen to name them using a formatting like <report_name> - <object_name or suffix> . Improve report naming in hr_attendance, hr_expense and hr_payroll. --- addons/hr_attendance/report/hr_employee_badge.xml | 7 +++---- addons/hr_expense/report/report_expense_sheet.xml | 4 +--- addons/hr_payroll/views/hr_payroll_report.xml | 9 +++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/hr_attendance/report/hr_employee_badge.xml b/addons/hr_attendance/report/hr_employee_badge.xml index d022b0829ba2..0961d0b178b2 100644 --- a/addons/hr_attendance/report/hr_employee_badge.xml +++ b/addons/hr_attendance/report/hr_employee_badge.xml @@ -6,10 +6,9 @@ model="hr.employee" report_type="qweb-pdf" name="hr_attendance.print_employee_badge" - file="hr_attendance.print_employee_badge"/> - <record id="hr_employee_print_badge" model="ir.actions.report"> - <field name="print_report_name">'Print Badge'+'-'+(object.name)</field> - </record> + file="hr_attendance.print_employee_badge" + print_report_name="'Print Badge - %s' % (object.name).replace('/', '')" + /> <template id="print_employee_badge"> <t t-call="web.basic_layout"> diff --git a/addons/hr_expense/report/report_expense_sheet.xml b/addons/hr_expense/report/report_expense_sheet.xml index aef3e1c2c776..ecbe3241ba2a 100644 --- a/addons/hr_expense/report/report_expense_sheet.xml +++ b/addons/hr_expense/report/report_expense_sheet.xml @@ -105,9 +105,7 @@ report_type="qweb-pdf" name="hr_expense.report_expense_sheet" file="hr_expense.report_expense_sheet" + print_report_name="'Expenses - %s - %s' % (object.employee_id.name, (object.name).replace('/', ''))" /> - <record id="action_report_hr_expense_sheet" model="ir.actions.report"> - <field name="print_report_name">'Expenses'+'-'+(object.employee_id.name)+'-'+(object.name)</field> - </record> </odoo> \ No newline at end of file diff --git a/addons/hr_payroll/views/hr_payroll_report.xml b/addons/hr_payroll/views/hr_payroll_report.xml index 6b1e8a94637c..e9c4ac11ccf4 100644 --- a/addons/hr_payroll/views/hr_payroll_report.xml +++ b/addons/hr_payroll/views/hr_payroll_report.xml @@ -16,10 +16,9 @@ report_type="qweb-pdf" name="hr_payroll.report_payslip" file="hr_payroll.report_payslip" + print_report_name="'Payslip - %s' % (object.employee_id.name)" /> - <record id="action_report_payslip" model="ir.actions.report"> - <field name="print_report_name">(object.employee_id.name)+'-'+'Payslip'</field> - </record> + <report id="payslip_details_report" model="hr.payslip" @@ -27,8 +26,6 @@ report_type="qweb-pdf" name="hr_payroll.report_payslipdetails" file="hr_payroll.report_payslipdetails" + print_report_name="'Payslip Details - %s' % (object.employee_id.name)" /> - <record id="payslip_details_report" model="ir.actions.report"> - <field name="print_report_name">(object.name)</field> - </record> </odoo> -- GitLab