[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:
@@ -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>
|
||||
|
||||
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user