[IMP] report: in convert.py, allows to use the tag 'paperformat' in a report definition using the paperformat id

This commit is contained in:
Damien Bouvy
2015-02-02 17:32:34 +01:00
parent 21c6996d2a
commit 91b2ec771f
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -89,6 +89,7 @@
<rng:optional> <rng:attribute name="attachment" /> </rng:optional>
<rng:optional> <rng:attribute name="attachment_use" /> </rng:optional>
<rng:optional> <rng:attribute name="groups"/> </rng:optional>
<rng:optional> <rng:attribute name="paperformat"/> </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 -->
+4
View File
@@ -342,6 +342,10 @@ form: module.record_id""" % (xml_id,)
group_id = self.id_get(cr, group)
groups_value.append((4, group_id))
res['groups_id'] = groups_value
if rec.get('paperformat'):
pf_name = rec.get('paperformat')
pf_id = self.id_get(cr,pf_name)
res['paperformat_id'] = pf_id
id = self.pool['ir.model.data']._update(cr, self.uid, "ir.actions.report.xml", self.module, res, xml_id, noupdate=self.isnoupdate(data_node), mode=self.mode)
self.idref[xml_id] = int(id)