콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2553 화면
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'
아바타
취소

Hi can you post your code too?

작성자 베스트 답변

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

아바타
취소

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

작성자

Thank you very much i will try it and update you

베스트 답변

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.

아바타
취소