KERNEL/BASE: add tag header for report xml

bzr revid: ced-8d83f844342fb6bc654289e8a1effd5dc4f40167
This commit is contained in:
ced 2007-04-16 13:48:40 +00:00
parent 3f2603b3a7
commit a05bd9300e
3 changed files with 6 additions and 2 deletions

View File

@ -92,11 +92,13 @@ class report_xml(osv.osv):
'report_xml': fields.char('XML path', size=256),
'report_rml': fields.char('RML path', size=256),
'auto': fields.boolean('Automatic XSL:RML', required=True),
'usage': fields.char('Action Usage', size=32)
'usage': fields.char('Action Usage', size=32),
'header': fields.boolean('Add RML header'),
}
_defaults = {
'type': lambda *a: 'ir.actions.report.xml',
'auto': lambda *a: True,
'header': lambda *a: True,
}
report_xml()

View File

@ -189,7 +189,7 @@ def register_all(db):
cr.close()
for r in result:
if r['report_rml']:
report_sxw('report.'+r['report_name'], r['model'], opj('addons',r['report_rml']))
report_sxw('report.'+r['report_name'], r['model'], opj('addons',r['report_rml']), header=r['header'])
if r['report_xsl']:
report_rml('report.'+r['report_name'], r['model'], opj('addons',r['report_xml']), r['report_xsl'] and opj('addons',r['report_xsl']))

View File

@ -132,6 +132,8 @@ class xml_import(object):
res[dest] = rec.getAttribute(field).encode('utf8')
if rec.hasAttribute('auto'):
res['auto'] = eval(rec.getAttribute('auto'))
if rec.hasAttribute('header'):
res['header'] = eval(rec.getAttribute('header'))
xml_id = rec.getAttribute('id').encode('utf8')
id = self.pool.get('ir.model.data')._update(cr, self.uid, "ir.actions.report.xml", self.module, res, xml_id, mode=self.mode)
self.idref[xml_id] = id