health-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Health-dev] Redefinning reports


From: Angel Arancibia
Subject: [Health-dev] Redefinning reports
Date: Tue, 11 Dec 2012 22:42:27 -0300

Hi, i'm trying to redefine reports.

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):

################
__init__.py:

      from health_lab_ihor import *

###############
__tryton__.py
###############
{
    'name': 'GNU Health : Free Health and Hospital Information System',
    'name_es_ES': 'GNU Health : Sistema Libre de Gestión Hospitalaria y de Salud',
    'version': 'Beta1',
    'author': 'CuatroGC',
    'email': 'address@hidden',
    'website': 'http://www.cuatrogc.com',
    'description': '''''',
    'description_es_ES': ''' Adaptacion especifica para laboratorios ''',
    'depends': [ 'health_lab' ],
    'xml': [ 'health_lab_ihor_report.xml' ],
    'translation': [ ],
}
#############
health_lab_ihor_report.xml
##############
<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> 
############

Exec

$> trytond -d DATABASE -u health_lab_ihor

But when I try to print a lab report, it throw this error.

$> trytond -c ~/test3/etc/trytond.conf --debug
[Tue Dec 11 18:59:42 2012] INFO:server:using /home/health/test3/etc/trytond.conf as configuration file
[Tue Dec 11 18:59:42 2012] INFO:server:initialising distributed objects services
[Tue Dec 11 18:59:42 2012] INFO:server:starting JSON-RPC protocol on xxxx:8000
[Tue Dec 11 18:59:42 2012] INFO:server:starting WebDAV protocol on xxxx:8080
.....
> /usr/lib/pymodules/python2.6/genshi/template/eval.py(410)undefined()
-> raise UndefinedError(key, owner=owner)
(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 ?

Thanks,

Angel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]