On 22/02/12 21:40 -0300, Felipe Alvarez Harnecker wrote:
> Hi,
>
> i want to develop a custom invoice report for printing, so to start i've
> copied the .odt to my
> module directory an added this records
>
>
> <record model="ir.action.report" id="report_invoice_report">
> <field name="name">Factura Report</field>
> <field name="model">account.invoice</field>
> <field name="report_name">ql_maquina.invoice.report</field>
> <field name="report">ql_maquina/invoice.odt</field>
> <field name="style">company/header_A4.odt</field>
> </record>
>
> <record model="ir.action.keyword" id="report_invoice_report_keyword">
> <field name="keyword">form_print</field>
> <field name="model">account.invoice,-1</field>
> <field name="action" ref="report_invoice_report"/>
> </record>
>
>
> when i call the report via the client i get this error:
>
>
> Error: 'ascii' codec can't decode byte 0x84 in position 85: ordinal not in
> range(128)
>
> Traceback (most recent call last):
> File "/dist-packages/trytond/protocols/jsonrpc.py", line 108, in
> _marshaled_dispatch
> response['result'] = dispatch_method(method, params)
> File "/dist-packages/trytond/protocols/jsonrpc.py", line 147, in _dispatch
> res = dispatch(*args)
> File "/dist-packages/trytond/protocols/dispatcher.py", line 155, in dispatch
> res = getattr(obj, method)(*args_without_context, **kargs)
> File "/dist-packages/trytond/report/report.py", line 134, in execute
> type, data = self.parse(action_report, objects, datas, {})
> File "/dist-packages/trytond/report/report.py", line 264, in parse
> data = rel_report(**localcontext).render()
> File "/dist-packages/relatorio/templates/base.py", line 36, in render
> return self.serializer(self.events)
> File "/dist-packages/relatorio/templates/opendocument.py", line 753, in
> __call__
> for kind, data, pos in stream:
> File "/dist-packages/genshi/core.py", line 288, in _ensure
> for event in stream:
> File "/dist-packages/genshi/filters/i18n.py", line 683, in __call__
> for kind, data, pos in stream:
> File "/dist-packages/genshi/template/base.py", line 605, in _include
> for event in stream:
> File "/dist-packages/genshi/template/markup.py", line 327, in _match
> for event in stream:
> File "/dist-packages/genshi/template/base.py", line 585, in _flatten
> stream = _apply_directives(data[1], data[0], ctxt, vars)
> File "/dist-packages/genshi/template/base.py", line 262, in
> _apply_directives
> stream = directives[0](iter(stream), directives[1:], ctxt, **vars)
> File "/dist-packages/genshi/template/directives.py", line 400, in __call__
> value = _eval_expr(self.expr, ctxt, vars)
> File "/dist-packages/genshi/template/base.py", line 277, in _eval_expr
> retval = expr.evaluate(ctxt)
> File "/dist-packages/genshi/template/eval.py", line 178, in evaluate
> return eval(self.code, _globals, {'__data__': data})
> File "/dist-packages/genshi/template/eval.py", line 309, in lookup_name
> val = cls.undefined(name)
> File "/dist-packages/genshi/template/eval.py", line 410, in undefined
> raise UndefinedError(key, owner=owner)
> UndefinedError: "company" not defined
>
>
> but the templates are identical (cheked with cmp)
>
> any clue??As you use the company header, you must instanciate a CompanyReport or put in the evaluation context of the report 'company'. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpR4IKwT1Zg0.pgp
Description: PGP signature
