bugGNU Health - Bugs: bug #43542, Patient medication history report...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #43542: Patient medication history report crashes when it is not filled the field "Indication"

Submitted by:  Fabián C. <fabyc>
Submitted on:  Wed 05 Nov 2014 06:03:16 PM UTC  
 
Category:  reporting Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  None
Module:  health

Thu 23 Apr 2015 06:49:43 AM UTC, comment #1: 

I can confirm this. The report is trying to access an attribute on the indication without checking if indication actually exists. I just pushed a commit to check for indication which should fix this issue. Thanks for the report!

Chris Zimmerman <teffalump>
Project Member
Wed 05 Nov 2014 06:03:16 PM UTC, original submission:  

- In patient form, tab "medication" add some medication. To the medicine don't fill the field "Indication".

- When click in "Medication" report of the patient, it launchs this error:

Traceback (most recent call last):
  File "/trytond/protocols/jsonrpc.py", line 125, in _marshaled_dispatch
    response['result'] = dispatch_method(method, params)
  File "/trytond/protocols/jsonrpc.py", line 158, in _dispatch
    res = dispatch(*args)
  File "/trytond/protocols/dispatcher.py", line 159, in dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/report/report.py", line 128, in execute
    type, data = cls.parse(action_report, records, data, {})
  File "/trytond/report/report.py", line 277, in parse
    data = rel_report(**localcontext).render()
  File "/local/lib/python2.7/site-packages/relatorio/templates/base.py", line 34, in render
    return self.serializer(self.events)
  File "/local/lib/python2.7/site-packages/relatorio/templates/opendocument.py", line 855, in _call_
    for kind, data, pos in stream:
  File "/local/lib/python2.7/site-packages/genshi/core.py", line 289, in _ensure
    for event in stream:
  File "/local/lib/python2.7/site-packages/genshi/filters/i18n.py", line 690, in _call_
    for kind, data, pos in stream:
  File "/local/lib/python2.7/site-packages/genshi/template/base.py", line 618, in _include
    for event in stream:
  File "/local/lib/python2.7/site-packages/genshi/template/markup.py", line 326, in _match
    for event in stream:
  File "/local/lib/python2.7/site-packages/genshi/template/base.py", line 558, in _flatten
    for kind, data, pos in stream:
  File "/local/lib/python2.7/site-packages/genshi/template/directives.py", line 169, in _generate
    attrs = _eval_expr(self.expr, ctxt, vars)
  File "/local/lib/python2.7/site-packages/genshi/template/base.py", line 289, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/local/lib/python2.7/site-packages/genshi/template/eval.py", line 177, in evaluate
    return eval(self.code, globals, {'__data_': data})
  File "<string>", line 1, in <Expression u"{'{urn:oasis:names:tc:opendocument:xmlns:office:1.0}value': __relatorio_store_cache(66824960, medication.indication.name or ''), '{urn:oasis:names:tc:opendocument:xmlns:office:1.0}value-type': __relatorio_guess_type(__relatorio_get_cache(66824960))}">
  File "/local/lib/python2.7/site-packages/genshi/template/eval.py", line 325, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/local/lib/python2.7/site-packages/genshi/template/eval.py", line 413, in undefined
    raise UndefinedError(key, owner=owner)
UndefinedError: None has no member named "name"

When it is filled the field "Indication", the report works very well.

Fabián C. <fabyc>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by teffalump (Posted a comment)
  • -email is unavailable- added by fabyc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-23 teffalump StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.7