From 3a52e5e5c97e9dba09a046752ac11532edcfb90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= <tde@odoo.com> Date: Fri, 31 Mar 2017 14:07:11 +0200 Subject: [PATCH] [IMP] import, report: allow print_report_name when defining a report Otherwise you have to have another xml block just to define the print report name instead of doing everything in the report tag. --- odoo/import_xml.rng | 1 + odoo/tools/convert.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/odoo/import_xml.rng b/odoo/import_xml.rng index adcbd19e0333..81fef2b35c6c 100644 --- a/odoo/import_xml.rng +++ b/odoo/import_xml.rng @@ -73,6 +73,7 @@ <rng:attribute name="string"/> <rng:attribute name="model"/> <rng:attribute name="name"/> + <rng:optional><rng:attribute name="print_report_name"/></rng:optional> <rng:optional><rng:attribute name="report_type"/></rng:optional> <rng:optional><rng:attribute name="multi"/></rng:optional> <rng:optional><rng:attribute name="menu"/></rng:optional> diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index 7e8e9f6e3ce5..76c7ec523af5 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -285,8 +285,14 @@ form: module.record_id""" % (xml_id,) for dest,f in (('name','string'),('model','model'),('report_name','name')): res[dest] = rec.get(f,'').encode('utf8') assert res[dest], "Attribute %s of report is empty !" % (f,) - for field,dest in (('attachment','attachment'),('attachment_use','attachment_use'), ('usage','usage'), - ('file', 'report_file'), ('report_type', 'report_type'), ('parser', 'parser')): + for field, dest in (('attachment', 'attachment'), + ('attachment_use', 'attachment_use'), + ('usage', 'usage'), + ('file', 'report_file'), + ('report_type', 'report_type'), + ('parser', 'parser'), + ('print_report_name', 'print_report_name'), + ): if rec.get(field): res[dest] = rec.get(field).encode('utf8') if rec.get('auto'): -- GitLab