* pjalrimba rimbabara [2011-12-19 05:45 +0100]:
When i try to print report one2many this error out: How can I define
my class in report.

Traceback (most recent call last):
 File "/trytond/protocols/jsonrpc.py", line 108, in
_marshaled_dispatch
   response['result'] = dispatch_method(method, params)
 File "/trytond/protocols/jsonrpc.py", line 147, in _dispatch
   res = dispatch(*args)
 File "/trytond/protocols/dispatcher.py", line 155, in dispatch
   res = getattr(obj, method)(*args_without_context, **kargs)
 File "/trytond/report/report.py", line 134, in execute
   type, data = self.parse(action_report, objects, datas, {})
 File "/trytond/report/report.py", line 258, in parse
   data = rel_report(**localcontext).render()
 File "/relatorio/templates/base.py", line 36, in render
   return self.serializer(self.events)
 File "/relatorio/templates/opendocument.py", line 753, in __call__
   for kind, data, pos in stream:
 File "/genshi/core.py", line 288, in _ensure
   for event in stream:
 File "/genshi/filters/i18n.py", line 683, in __call__
   for kind, data, pos in stream:
 File "/genshi/template/base.py", line 605, in _include
   for event in stream:
 File "/genshi/template/markup.py", line 327, in _match
   for event in stream:
 File "/genshi/template/base.py", line 545, in _flatten
   for kind, data, pos in stream:
 File "/genshi/template/directives.py", line 359, in __call__
   iterable = _eval_expr(self.expr, ctxt, vars)
 File "/genshi/template/base.py", line 277, in _eval_expr
   retval = expr.evaluate(ctxt)
 File "/genshi/template/eval.py", line 178, in evaluate
   return eval(self.code, _globals, {'__data__': data})
 File "/genshi/template/eval.py", line 309, in lookup_name
   val = cls.undefined(name)
 File "/genshi/template/eval.py", line 410, in undefined
   raise UndefinedError(key, owner=owner)
UndefinedError: "employee" not defined

I guess you're writing a custom report.
In the company module there is an example of how to add a 'variable'
in the context of the report (look for CompanyReport).

--
Nicolas Évrard

B2CK SPRL
rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
E-mail/Jabber: [email protected]
Website: http://www.b2ck.com/

--
[email protected] mailing list

Reply via email to