|
From: | Yusif Suleiman |
Subject: | Re: [Health-dev] PUID on Invoice in GNUHealth |
Date: | Wed, 13 Apr 2022 10:52:36 +0000 |
Hi Lius,
I added the party puid on the invoice report as <PATIENT.PUID>, just as on patient_card.fodt, but I got an error, I change the code with <party.puid> as well as <invoice.party.puid>.
But all with errors. What do I miss, please. See samples below.
Regards,
Yusuf
Traceback (most recent call last):
File "/trytond/wsgi.py", line 89, in dispatch_request
return endpoint(request, **request.view_args)
File "/trytond/protocols/dispatcher.py", line 45, in rpc
request, database_name, *request.rpc_params)
File "/trytond/wsgi.py", line 60, in auth_required
return wrapped(*args, **kwargs)
File "/trytond/protocols/wrappers.py", line 122, in wrapper
return func(request, pool, *args, **kwargs)
File "/trytond/protocols/dispatcher.py", line 175, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/trytond/modules/account_invoice/invoice.py", line 2454, in execute
result = super(InvoiceReport, cls).execute(ids, data)
File "/trytond/report/report.py", line 183, in execute
oext, content = cls._execute(records, data, action_report)
File "/trytond/modules/account_invoice/invoice.py", line 2435, in _execute
result = super(InvoiceReport, cls)._execute(records, data, action)
File "/trytond/report/report.py", line 191, in _execute
return cls.convert(action, cls.render(action, report_context))
File "/trytond/report/report.py", line 289, in render
data = "">
File "/relatorio/templates/base.py", line 35, in render
self.events, method=method, encoding=encoding, out=out)
File "/relatorio/templates/opendocument.py", line 1179, in __call__
self.xml_serializer(writer(stream)), encoding=encoding, out=writer)
File "/site-packages/genshi/output.py", line 58, in encode
for chunk in iterator:
File "/site-packages/genshi/output.py", line 241, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/output.py", line 669, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/output.py", line 774, in __call__
for kind, data, pos in chain(stream, [(None, None, None)]):
File "/site-packages/genshi/output.py", line 594, in __call__
for ev in stream:
File "/relatorio/templates/opendocument.py", line 1071, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/core.py", line 289, in _ensure
for event in stream:
File "/site-packages/genshi/filters/i18n.py", line 690, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/template/base.py", line 617, in _include
for event in stream:
File "/site-packages/genshi/template/markup.py", line 326, in _match
for event in stream:
File "/site-packages/genshi/template/base.py", line 577, in _flatten
result = _eval_expr(data, ctxt, vars)
File "/site-packages/genshi/template/base.py", line 289, in _eval_expr
retval = expr.evaluate(ctxt)
File "/site-packages/genshi/template/eval.py", line 178, in evaluate
return eval(self.code, _globals, {'__data__': data})
File "<string>", line 641, in <_expression_ '__relatorio_escape_invalid_chars(patient.puid)'>
File "/site-packages/genshi/template/eval.py", line 311, in lookup_name
val = cls.undefined(name)
File "/site-packages/genshi/template/eval.py", line 414, in undefined
raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: "patient" not defined
Traceback (most recent call last):
File "/trytond/model/modelstorage.py", line 1291, in __getattr__
field = self._fields[name]
KeyError: 'puid'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/site-packages/genshi/template/eval.py", line 318, in lookup_attr
val = getattr(obj, key)
File "/trytond/model/modelstorage.py", line 1293, in __getattr__
raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "party.party,12" has no attribute "puid"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/site-packages/genshi/template/eval.py", line 324, in lookup_attr
val = obj[key]
TypeError: 'party.party' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/trytond/wsgi.py", line 89, in dispatch_request
return endpoint(request, **request.view_args)
File "/trytond/protocols/dispatcher.py", line 45, in rpc
request, database_name, *request.rpc_params)
File "/trytond/wsgi.py", line 60, in auth_required
return wrapped(*args, **kwargs)
File "/trytond/protocols/wrappers.py", line 122, in wrapper
return func(request, pool, *args, **kwargs)
File "/trytond/protocols/dispatcher.py", line 175, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/trytond/modules/account_invoice/invoice.py", line 2454, in execute
result = super(InvoiceReport, cls).execute(ids, data)
File "/trytond/report/report.py", line 183, in execute
oext, content = cls._execute(records, data, action_report)
File "/trytond/modules/account_invoice/invoice.py", line 2435, in _execute
result = super(InvoiceReport, cls)._execute(records, data, action)
File "/trytond/report/report.py", line 191, in _execute
return cls.convert(action, cls.render(action, report_context))
File "/trytond/report/report.py", line 289, in render
data = "">
File "/relatorio/templates/base.py", line 35, in render
self.events, method=method, encoding=encoding, out=out)
File "/relatorio/templates/opendocument.py", line 1179, in __call__
self.xml_serializer(writer(stream)), encoding=encoding, out=writer)
File "/site-packages/genshi/output.py", line 58, in encode
for chunk in iterator:
File "/site-packages/genshi/output.py", line 241, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/output.py", line 669, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/output.py", line 774, in __call__
for kind, data, pos in chain(stream, [(None, None, None)]):
File "/site-packages/genshi/output.py", line 594, in __call__
for ev in stream:
File "/relatorio/templates/opendocument.py", line 1071, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/core.py", line 289, in _ensure
for event in stream:
File "/site-packages/genshi/filters/i18n.py", line 690, in __call__
for kind, data, pos in stream:
File "/site-packages/genshi/template/base.py", line 617, in _include
for event in stream:
File "/site-packages/genshi/template/markup.py", line 326, in _match
for event in stream:
File "/site-packages/genshi/template/base.py", line 577, in _flatten
result = _eval_expr(data, ctxt, vars)
File "/site-packages/genshi/template/base.py", line 289, in _eval_expr
retval = expr.evaluate(ctxt)
File "/site-packages/genshi/template/eval.py", line 178, in evaluate
return eval(self.code, _globals, {'__data__': data})
File "<string>", line 634, in <_expression_ '__relatorio_escape_invalid_chars(invoice.party.puid)'>
File "/site-packages/genshi/template/eval.py", line 326, in lookup_attr
val = cls.undefined(key, owner=obj)
File "/site-packages/genshi/template/eval.py", line 414, in undefined
raise UndefinedError(key, owner=owner)
genshi.template.eval.UndefinedError: Pool().get('party.party')(12) has no member named "puid"
From: Health-dev <health-dev-bounces+yusifsuleiman=hotmail.com@gnu.org> on behalf of Luis Falcon <falcon@gnuhealth.org>
Sent: Wednesday, April 13, 2022 11:05 AM To: health-dev@gnu.org <health-dev@gnu.org> Subject: Re: [Health-dev] PUID on Invoice in GNUHealth Hi, Yusif
On 4/10/22 13:01, Yusif Suleiman wrote: > Hi, > PUID on GNUHealth is the primary key which uniquely identify a > party/patient. > > While working with gnuhealth for a small diagnostic centre, I realized > the PUID is not in any position on the invoice. > > Please, how can I make the PUID to appear on the invoice as a party ID. > Regards, > Yusif You could add a field with the party PUID on the invoice report. A simple examples is on the patient_card.fodt report in the core module. Bests, Luis -- Dr. Luis Falcon, MD, MSc President, GNU Solidario Advancing Social Medicine www.gnusolidario.org |
[Prev in Thread] | Current Thread | [Next in Thread] |