bugGNU Health - Bugs: bug #61877, Error when I open health service...

 
 

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

bug #61877: Error when I open health service report.

Submitter:  Feng Shu <tumashu>
Submitted:  Thu 20 Jan 2022 08:51:30 AM UTC
   
 
Category:  Programming / Tracebacks Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  meanmicio
Open/Closed:  Closed Release:  3.9.0
Module:  Health_services Component:  None

Wed 26 Jan 2022 07:35:35 PM UTC, comment #3: 

Hi Tumashu!

Now it should catch the rare event when no institution is provided.

Fixed in
https://hg.savannah.gnu.org/hgweb/health/rev/1e982753bd69

Please check and report back :)

Luis Falcon <meanmicio>
Group administrator
Tue 25 Jan 2022 12:56:04 AM UTC, comment #2: 


comment #1:

> It looks like you don't have an institution associated yet.
>
> Check under menu:
> Health -> Institutions


Setting instituation work.

>
> In any case, I've updated the health_service report to avoid traceback if there is no institution.
>
> https://hg.savannah.gnu.org/hgweb/health/rev/3feb3b43286d


I think this commit is not solve the problem if I do not set institution.

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(args, *kwargs)
  File "/trytond/protocols/wrappers.py", line 159, in wrapper
    return func(request, pool, args, *kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(c_args, *c_kwargs))
  File "/trytond/report/report.py", line 215, in execute
    oext, content = cls._execute(
  File "/trytond/report/report.py", line 233, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "/trytond/report/report.py", line 329, in render
    data = template.generate(**report_context).render()
  File "/relatorio/templates/base.py", line 34, in render
    return self.serializer(
  File "/relatorio/templates/opendocument.py", line 1178, in _call_
    output_encode(
  File "/genshi/output.py", line 60, in encode
    for chunk in iterator:
  File "/genshi/output.py", line 243, in _call_
    for kind, data, pos in stream:
  File "/genshi/output.py", line 674, in _call_
    for kind, data, pos in stream:
  File "/genshi/output.py", line 779, in _call_
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/genshi/output.py", line 598, in _call_
    for ev in stream:
  File "/relatorio/templates/opendocument.py", line 1071, in _call_
    for kind, data, pos in stream:
  File "/genshi/filters/i18n.py", line 688, in _call_
    for kind, data, pos in stream:
  File "/genshi/template/base.py", line 641, in _include
    for event in stream:
  File "/genshi/template/markup.py", line 326, in _match
    for event in stream:
  File "/genshi/template/base.py", line 601, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/genshi/template/base.py", line 291, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/genshi/template/eval.py", line 160, in evaluate
    return eval(self.code, globals, {'__data_': data})
  File "<string>", line 245, in <Expression "__relatorio_escape_invalid_chars(healthservice.institution.rec_name or '')">
  File "/genshi/template/eval.py", line 309, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/genshi/template/eval.py", line 397, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: None has no member named "rec_name"

Fault: None has no member named "rec_name"



>
> Please verify and report :)
>
> Thank you!
>

Feng Shu <tumashu>
Thu 20 Jan 2022 08:13:37 PM UTC, comment #1: 

It looks like you don't have an institution associated yet.

Check under menu:
Health -> Institutions

In any case, I've updated the health_service report to avoid traceback if there is no institution.

https://hg.savannah.gnu.org/hgweb/health/rev/3feb3b43286d

Please verify and report :)

Thank you!

Luis Falcon <meanmicio>
Group administrator
Thu 20 Jan 2022 08:51:30 AM UTC, original submission:  

RROR:tryton.common.common:Traceback (most recent call last):
  File "/genshi/template/eval.py", line 301, in lookup_attr
    val = getattr(obj, key)
AttributeError: 'NoneType' object has no attribute 'rec_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/genshi/template/eval.py", line 307, in lookup_attr
    val = obj[key]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(args, *kwargs)
  File "/trytond/protocols/wrappers.py", line 159, in wrapper
    return func(request, pool, args, *kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(c_args, *c_kwargs))
  File "/trytond/report/report.py", line 215, in execute
    oext, content = cls._execute(
  File "/trytond/report/report.py", line 233, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "/trytond/report/report.py", line 329, in render
    data = template.generate(**report_context).render()
  File "/relatorio/templates/base.py", line 34, in render
    return self.serializer(
  File "/relatorio/templates/opendocument.py", line 1178, in _call_
    output_encode(
  File "/genshi/output.py", line 60, in encode
    for chunk in iterator:
  File "/genshi/output.py", line 243, in _call_
    for kind, data, pos in stream:
  File "/genshi/output.py", line 674, in _call_
    for kind, data, pos in stream:
  File "/genshi/output.py", line 779, in _call_
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/genshi/output.py", line 598, in _call_
    for ev in stream:
  File "/relatorio/templates/opendocument.py", line 1071, in _call_
    for kind, data, pos in stream:
  File "/genshi/filters/i18n.py", line 688, in _call_
    for kind, data, pos in stream:
  File "/genshi/template/base.py", line 641, in _include
    for event in stream:
  File "/genshi/template/markup.py", line 326, in _match
    for event in stream:
  File "/genshi/template/base.py", line 601, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "/genshi/template/base.py", line 291, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/genshi/template/eval.py", line 160, in evaluate
    return eval(self.code, globals, {'__data_': data})
  File "<string>", line 239, in <Expression '__relatorio_escape_invalid_chars(healthservice.institution.rec_name)'>
  File "/genshi/template/eval.py", line 309, in lookup_attr
    val = cls.undefined(key, owner=obj)
  File "/genshi/template/eval.py", line 397, in undefined
    raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: None has no member named "rec_name"

Fault: None has no member named "rec_name"

Feng Shu <tumashu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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 meanmicio (Posted a comment)
  • -email is unavailable- added by tumashu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-05 meanmicio StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-01-26 meanmicio StatusNeed Info Ready For Test
    2022-01-20 meanmicio StatusNone Need Info
        Assigned toNone meanmicio
        ReleaseNone 3.9.0

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code