i've created a new folder "trytond/modules/health_lab_ihor" (i will overwrite lab reports). Inside i've got (labtest_report_ihor.odt plus):
<data>
<!-- deactivate the old report one-->
<record model="ir.action.report" id="health_lab.report_patient_labtest_report">
<field name="active" eval="False"/>
</record>
<!-- activate the new one -->
<record model="ir.action.report" id="report_patient_labtest_report_ihor">
<field name="name">Reporte de Laborarotio</field>
<field name="model">gnuhealth.lab</field>
<field name="report_name">patient.labtest.report.ihor</field>
<field name="report">health_lab_ihor/labtest_report_ihor.odt</field>
<field name="style">company/header_A4.odt</field>
</record>
<record model="ir.action.keyword" id="report_patient_labtest_report_keyword_ihor">
<field name="keyword">form_print</field>
<field name="model">gnuhealth.lab,-1</field>
<field name="action" ref="report_patient_labtest_report_ihor"/>
</record>
</data>
But when I try to print a lab report, it throw this error.
.....
(Pdb) w
/home/health/test3/lib/python2.6/site-packages/trytond/protocols/jsonrpc.py(123)_marshaled_dispatch()
-> response['result'] = dispatch_method(method, params)
/home/health/test3/lib/python2.6/site-packages/trytond/protocols/jsonrpc.py(156)_dispatch()
-> res = dispatch(*args)
/home/health/test3/lib/python2.6/site-packages/trytond/protocols/dispatcher.py(159)dispatch()
-> res = getattr(obj, method)(*args_without_context, **kargs)
/home/health/test3/lib/python2.6/site-packages/trytond/report/report.py(131)execute()
-> type, data = "" objects, datas, {})
/home/health/test3/lib/python2.6/site-packages/trytond/report/report.py(263)parse()
-> data = "">
/usr/lib/pymodules/python2.6/relatorio/templates/base.py(36)render()
-> return self.serializer(self.events)
/usr/lib/pymodules/python2.6/relatorio/templates/opendocument.py(753)__call__()
-> for kind, data, pos in stream:
/usr/lib/pymodules/python2.6/genshi/core.py(288)_ensure()
-> for event in stream:
/usr/lib/pymodules/python2.6/genshi/filters/i18n.py(683)__call__()
-> for kind, data, pos in stream:
/usr/lib/pymodules/python2.6/genshi/template/base.py(605)_include()
-> for event in stream:
/usr/lib/pymodules/python2.6/genshi/template/markup.py(327)_match()
-> for event in stream:
/usr/lib/pymodules/python2.6/genshi/template/base.py(585)_flatten()
-> stream = _apply_directives(data[1], data[0], ctxt, vars)
/usr/lib/pymodules/python2.6/genshi/template/base.py(262)_apply_directives()
-> stream = directives[0](iter(stream), directives[1:], ctxt, **vars)
/usr/lib/pymodules/python2.6/genshi/template/directives.py(400)__call__()
-> value = _eval_expr(self.expr, ctxt, vars)
/usr/lib/pymodules/python2.6/genshi/template/base.py(277)_eval_expr()
-> retval = expr.evaluate(ctxt)
/usr/lib/pymodules/python2.6/genshi/template/eval.py(178)evaluate()
-> return eval(self.code, _globals, {'__data__': data})
/tmp/trytond_Lk9GvZ.odt(1)<_expression_ u'company'>()
-> P]�|A^�2
'mimetypeapplication/vnd.oasis.opendocument.textP]�|A��''▒Thumbnails/thumbnail.png�PNG
/usr/lib/pymodules/python2.6/genshi/template/eval.py(309)lookup_name()
-> val = cls.undefined(name)
> /usr/lib/pymodules/python2.6/genshi/template/eval.py(410)undefined()
-> raise UndefinedError(key, owner=owner)
(Pdb) exit
I've try with the original template too, and same error, so I think it must be something wrong in my definition. What are those bad-encoding-characters ?
Can you try without this line:
<field name="style">company/header_A4.odt</field>
In order to delete the style from the report maybe you have to check in:
Administration -> User Interface -> Actions -> Reports
Search for your report, delete the style field and try again.
Let me know if it still shows the same error...
Regards
--