[IMP] rng,convert: add support for report `usage` attribute
The `usage` attribute may indicate a special purpose of this report. For instance, the "default" usage is used to identify the report to include along with a record for EDI exports. bzr revid: odo@openerp.com-20111010142226-ceradf4acsbr3r5l
This commit is contained in:
parent
9857cb60fa
commit
0c9e9a7643
|
@ -114,6 +114,10 @@
|
||||||
<rng:optional> <rng:attribute name="attachment" /> </rng:optional>
|
<rng:optional> <rng:attribute name="attachment" /> </rng:optional>
|
||||||
<rng:optional> <rng:attribute name="attachment_use" /> </rng:optional>
|
<rng:optional> <rng:attribute name="attachment_use" /> </rng:optional>
|
||||||
<rng:optional> <rng:attribute name="groups"/> </rng:optional>
|
<rng:optional> <rng:attribute name="groups"/> </rng:optional>
|
||||||
|
<!-- `Usage` may help identify the best report for a certain task,
|
||||||
|
for example usage="default" for reports that are attached by
|
||||||
|
default in EDI exports -->
|
||||||
|
<rng:optional><rng:attribute name="usage"/></rng:optional>
|
||||||
<rng:empty />
|
<rng:empty />
|
||||||
</rng:element>
|
</rng:element>
|
||||||
</rng:define>
|
</rng:define>
|
||||||
|
|
|
@ -314,7 +314,8 @@ form: module.record_id""" % (xml_id,)
|
||||||
for dest,f in (('name','string'),('model','model'),('report_name','name')):
|
for dest,f in (('name','string'),('model','model'),('report_name','name')):
|
||||||
res[dest] = rec.get(f,'').encode('utf8')
|
res[dest] = rec.get(f,'').encode('utf8')
|
||||||
assert res[dest], "Attribute %s of report is empty !" % (f,)
|
assert res[dest], "Attribute %s of report is empty !" % (f,)
|
||||||
for field,dest in (('rml','report_rml'),('file','report_rml'),('xml','report_xml'),('xsl','report_xsl'),('attachment','attachment'),('attachment_use','attachment_use')):
|
for field,dest in (('rml','report_rml'),('file','report_rml'),('xml','report_xml'),('xsl','report_xsl'),
|
||||||
|
('attachment','attachment'),('attachment_use','attachment_use'), ('usage','usage')):
|
||||||
if rec.get(field):
|
if rec.get(field):
|
||||||
res[dest] = rec.get(field).encode('utf8')
|
res[dest] = rec.get(field).encode('utf8')
|
||||||
if rec.get('auto'):
|
if rec.get('auto'):
|
||||||
|
|
Loading…
Reference in New Issue