Skip to Content
Menu
This question has been flagged
2 Replies
2020 Views
Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 2106, in report_download
    response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
  File "/opt/odoo14/odoo/odoo/http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 2041, in report_routes
    pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]
  File "/opt/odoo14/odoo/odoo/addons/base/models/ir_actions_report.py", line 741, in _render_qweb_pdf
    Model = self.env[self_sudo.model]
  File "/opt/odoo14/odoo/odoo/api.py", line 473, in __getitem__
    return self.registry[model_name]._browse(self, (), ())
  File "/opt/odoo14/odoo/odoo/modules/registry.py", line 177, in __getitem__
    return self.models[model_name]
KeyError: 'hr.holidays.summary.dept'
Avatar
Discard

Hi can you post your code too?

Author Best Answer

Wow, i am new to Odoo and python as well.

Where and how do i implement your solution below

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%d-%m-%Y %H:%M')"/>

Maybe a few steps might help

Avatar
Discard

I hope your printing a pdf report in odoo, in your qweb file you can place the above code wherever you want to show the time in your pdf.

https://www.odoo.com/documentation/14.0/reference/reports.html check this for developing

<tr>

<td>

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%d-%m-%Y %H:%M')"/>

</td>

</tr>

If your making changes to the default odoo reports make sure you inherit the report as in documentation

Author

Thank you very much i will try it and update you

Best Answer

Hi,

    I guess your printing the current date and time of generation of the report (qweb)

Try the below code,

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%d-%m-%Y %H:%M')"/>

Hope it helps,

Thanks.

Avatar
Discard