值错误:在系统中找不到外部ID:todo_report.report_todo_task_temp报告

2024-04-26 01:26:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图将报表添加到应用程序中,但它不起作用,并出现错误:

ValueError: External ID not found in the system: todo_report.report_todo_task_template

<?xml version="1.0" encoding="utf-8"?>
<odoo>
  <report id="action_todo_model_report" 
          string="To-do Report" 
          model="todo.task" 
          report_type="qweb-html" 
          name="todo_report.report_todo_task_template" />

  <template id="report_todo_task_template">
    <t t-call="web.html_container">
      <t t-call="web.external_layout">
        <div class="page">
          <div class="container">
            <div class="row bg-primary">
                <div class="col-3">name</div>
                <div class="col-2">start date</div>
                <div class="col-2">deadline</div>
                <div class="col-3">Gov</div>
                <div class="col-2"> amount </div>
            </div>
            <t t-foreach="docs" t-as="o">
              <div class="'row">
                <div class="col-3">
                  <h4><span t-field="o.name" /></h4>
                </div>
                <div class="col-2">
                  <span t-field="o.start_date" />
                </div>
                <div class="col-2">
                  <span t-field="o.deadline_date" />
                </div>
                <div class="col-3">
                  <span t-field="o.gov_dep_id" />
                </div>
                <div class="col-3">
                  <span t-field="o.amount" />
                </div>
              </div>
            </t>
          </div>
        </div>    
      </t>
    </t>
  </template>
</odoo>

这是浏览器显示的消息

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

我的错误是什么? 你能帮我什么忙?在

我将报告添加到__manifest__中作为数据


Tags: thenameinreportdividfieldtask
1条回答
网友
1楼 · 发布于 2024-04-26 01:26:27

请通过激活开发人员模式,然后激活设置->序列和标识符->外部标识符,检查Odoo中是否存在“XML ID”。在搜索栏中搜索“报表”“待办事项”“任务模板”,如果您看到记录,只需单击它,然后从详细视图复制整个ID。这对我很有帮助,因为在创建模块时,我将“report”作为“reports”的复数形式,这样您就可以在设置中找到确切的ID。在

相关问题 更多 >