Skip to Content
Menu
This question has been flagged
1 Reply
1654 Views

We have Odoo 17 Enterprise, All PDF Reports (General Ledger For Example) do not work, all of them give the following Error : 



RPC_ERROR

Odoo Server Error

Traceback (most recent call last):

  File "", line 141, in template_919

  File "", line 81, in template_919_content

KeyError: 'doc'


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


Traceback (most recent call last):

  File "/home/odoo/src/enterprise/17.0/account_reports/controllers/main.py", line 31, in get_report

    generated_file_data = report.dispatch_report_action(options, file_generator)

  File "/home/odoo/src/enterprise/17.0/account_reports/models/account_report.py", line 2043, in dispatch_report_action

    return getattr(self, action)(*args)

  File "/home/odoo/src/enterprise/17.0/account_reports/models/account_report.py", line 4818, in export_to_pdf

    footer = self.env['ir.actions.report']._render_template("account_reports.internal_layout", values=rcontext)

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_actions_report.py", line 654, in _render_template

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

  File "/home/odoo/src/odoo/17.0/addons/website/models/ir_ui_view.py", line 442, in _render_template

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

  File "/home/odoo/src/enterprise/17.0/web_studio/models/ir_ui_view.py", line 1310, in _render_template

    return super(View, self)._render_template(template, values)

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_ui_view.py", line 2050, in _render_template

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

  File "/home/odoo/src/odoo/17.0/odoo/tools/profiler.py", line 292, in _tracked_method_render

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

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_qweb.py", line 593, in _render

    result = ''.join(rendering)

  File "", line 147, in template_919

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

KeyError: 'doc'

Template: account_reports.internal_layout

Path: /t/div[1]/div/div[3]/ul/li[2]/span

Node:


The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    at makeErrorFromResponse (https://brothercond.odoo.com/web/assets/1fa8e68/web.assets_web.min.js:2879:163)

    at decoder.onload (https://brothercond.odoo.com/web/assets/1fa8e68/web.assets_web.min.js:2865:7)


Looking for solution


Avatar
Discard
Best Answer

Hi,

1. Check Customizations:

If you've customized any report templates, ensure that the customizations haven't accidentally removed or altered the context variables like doc. Make sure that the doc variable is properly defined and passed to the template.

2. Update Odoo:

Ensure your Odoo installation is up to date.


Hope it helps

Avatar
Discard