Skip to Content
Menu
This question has been flagged
1 Odpoveď
483 Zobrazenia

RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "<1575>", line 97, in template_1575

  File "<1575>", line 79, in template_1575_content

  File "<1575>", line 62, in template_1575_t_call_0

  File "<1575>", line 10, in template_1575_t_call_1

KeyError: 'doc'


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "C:\odoo_16\odoo\addons\web\controllers\report.py", line 113, in report_download

    response = self.report_routes(reportname, docids=docids, converter=converter, context=context)

  File "C:\odoo_16\odoo\odoo\http.py", line 734, in route_wrapper

    result = endpoint(self, *args, **params_ok)

  File "C:\odoo_16\odoo\addons\web\controllers\report.py", line 42, in report_routes

    pdf = report.with_context(context)._render_qweb_pdf(reportname, docids, data=data)[0]

  File "C:\odoo_16\odoo\addons\account\models\ir_actions_report.py", line 61, in _render_qweb_pdf

    return super()._render_qweb_pdf(report_ref, res_ids=res_ids, data=data)

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_actions_report.py", line 896, in _render_qweb_pdf

    collected_streams = self._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)

  File "C:\odoo_16\odoo\addons\account_edi\models\ir_actions_report.py", line 14, in _render_qweb_pdf_prepare_streams

    collected_streams = super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)

  File "C:\odoo_16\odoo\addons\account\models\ir_actions_report.py", line 20, in _render_qweb_pdf_prepare_streams

    return super()._render_qweb_pdf_prepare_streams(report_ref, data, res_ids=res_ids)

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_actions_report.py", line 747, in _render_qweb_pdf_prepare_streams

    html = self.with_context(**additional_context)._render_qweb_html(report_ref, all_res_ids_wo_stream, data=data)[0]

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_actions_report.py", line 971, in _render_qweb_html

    return self._render_template(report.report_name, data), 'html'

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_actions_report.py", line 651, in _render_template

    return view_obj._render_template(template, values).encode()

  File "C:\odoo_16\odoo\addons\website\models\ir_ui_view.py", line 419, in _render_template

    return super()._render_template(template, values=values)

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_ui_view.py", line 2129, in _render_template

    return self.env['ir.qweb']._render(template, values)

  File "C:\odoo_16\odoo\odoo\tools\profiler.py", line 294, in _tracked_method_render

    return method_render(self, template, values, **options)

  File "C:\odoo_16\odoo\odoo\addons\base\models\ir_qweb.py", line 587, in _render

    result = ''.join(rendering)

  File "<1575>", line 103, in template_1575

odoo.addons.base.models.ir_qweb.QWebException: Error while render the template

KeyError: 'doc'

Template: school_management.report_student

Path: /t/t/t/div/table/tbody/tr[1]/td[2]/t

Node: <t t-esc="doc.name"/>


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPC_ERROR

        at makeErrorFromResponse (http://localhost:8080/web/assets/debug/web.assets_backend.js:10510:19) (/web/static/src/core/network/rpc_service.js:34)

        at decoder.onload (http://localhost:8080/web/assets/debug/web.assets_backend.js:10400:25) (/web/static/src/core/network/download.js:551)

Avatar
Zrušiť
Best Answer

Make sure that you correctly referenced the documentation using the syntax

<t t-foreach="docs" t-as="doc">
<t t-set="o" t-value="doc"/>
<t t-call="ofo_sales_pdf.iwave_oaf_pdf_report_document"/>
</t>

Additionally, verify that the corresponding module has the field "name" defined.

Avatar
Zrušiť