[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.
This commit is contained in:
Thibault Delavallée
2017-05-10 17:10:04 +02:00
parent dbe6aa4292
commit 3a52e5e5c9
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -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>
+8 -2
View File
@@ -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'):