Odoo 9 ValueError: External ID not found in the system:
Odoo 9 ValueError: External ID not found in the system:
我在这上面待了几个小时,想不通。我正在尝试从我创建的模块打印表单。单击打印按钮时,我一直收到以下错误消息。
raise ValueError('External ID not found in the system: %s' % (xmlid))
ValueError: External ID not found in the system: ch08.qweb_ds_repair_template
我的report.xml文件
<?xml version="1.0" encoding= "utf-8"?>
<openerp>
<data>
<template id="qweb_ds_repair_template">
<t t-call="report.html_container" >
<t t-foreach ="docs" t-as="o">
<t t-call ="report.external_layout">
<div class="page" >
<div class="oe_structure" />
<h1>Repair Form</h1>
<h2>Test: <span t-field="o.password"/></h2>
</div>
</t>
</t>
</t>
</template>
<report id="report_ds_repair_template"
name="ch08.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"
/>
</data>
</openerp>
我的模块文件夹名为 ds_repair。不确定我是否在我的 openerp.py 中缺少依赖项所以它在下面
{
'name': 'Repairs',
'version': '1.0',
'sequence': 200,
'category': 'Manufacturing',
'summary': 'Repair',
'description': """,
The aim is to have a complete module to manage all products repairs.
====================================================================
""",
'depends': ['base'],
'website': '',
'data': ['report/report.xml',
'model_view.xml',
],
'demo': [],
'installable': True,
'auto_install': False,
}
不确定,但我认为代替 ds_repair 的 ch08 是导致问题的原因。
我很确定点之前的文本是为命名空间或插件(插件文件夹)名称保留的。
<?xml version="1.0" encoding= "utf-8"?>
<openerp>
<data>
<report id="report_ds_repair_template"
name="ds_repair.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"/>
<template id="qweb_ds_repair_template">
<t t-call="report.html_container" >
<t t-foreach ="docs" t-as="o">
<t t-call ="report.external_layout">
<div class="page" >
<div class="oe_structure" />
<h1>Repair Form</h1>
<h2>Test: <span t-field="o.password"/></h2>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>
你的模块文件夹名称是“ds_repair”所以你应该写name="ds_repair.qweb_ds_repair_template"
<report id="report_ds_repair_template"
name="ds_repair.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"
/>
当你想引用另一个时,你有 2 种可能 xml_id。
你写:
<template inherited="module_name.xml_id">
当你想引用另一个模块中的 id 时通常使用此方法
或者你可以
<template inherited="xml_id">
在这种情况下,您想在编写代码的当前模块中引用一个 id。
您的错误来源可能是:
- 您没有名为 ch08 的模块
- 您有一个名为 ch08 的模块,但您在模块中没有 ID "qweb_ds_repair_template"
但我认为在您目前的情况下,您只想参考上面写的 id。
你可以写
<report id="report_ds_repair_template"
name="module_name.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"/>
PS :当我说 module_name 时,它是您的文件夹的名称。
对于我的案例odoo11,在搜索了很多页面之后,看看教程就可以了:
Finally restart Odoo and update the module’s data (to install the template) by going to Settings ‣ Modules ‣ Modules ‣ Academy and clicking Upgrade.
就我而言,我试图配置现有的 Odoo 9 项目。但是,当我在 custom_folder 中克隆模块时。我将其命名为 'odoo_xyz',但是在 openerp.py 中,它被写为 'xyz'。所以我将我克隆的模块重命名为 'xyz',重新启动 Odoo 9,然后创建一个新数据库。因此,它维护了一个新的参考系统。
我在这上面待了几个小时,想不通。我正在尝试从我创建的模块打印表单。单击打印按钮时,我一直收到以下错误消息。
raise ValueError('External ID not found in the system: %s' % (xmlid))
ValueError: External ID not found in the system: ch08.qweb_ds_repair_template
我的report.xml文件
<?xml version="1.0" encoding= "utf-8"?>
<openerp>
<data>
<template id="qweb_ds_repair_template">
<t t-call="report.html_container" >
<t t-foreach ="docs" t-as="o">
<t t-call ="report.external_layout">
<div class="page" >
<div class="oe_structure" />
<h1>Repair Form</h1>
<h2>Test: <span t-field="o.password"/></h2>
</div>
</t>
</t>
</t>
</template>
<report id="report_ds_repair_template"
name="ch08.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"
/>
</data>
</openerp>
我的模块文件夹名为 ds_repair。不确定我是否在我的 openerp.py 中缺少依赖项所以它在下面
{
'name': 'Repairs',
'version': '1.0',
'sequence': 200,
'category': 'Manufacturing',
'summary': 'Repair',
'description': """,
The aim is to have a complete module to manage all products repairs.
====================================================================
""",
'depends': ['base'],
'website': '',
'data': ['report/report.xml',
'model_view.xml',
],
'demo': [],
'installable': True,
'auto_install': False,
}
不确定,但我认为代替 ds_repair 的 ch08 是导致问题的原因。 我很确定点之前的文本是为命名空间或插件(插件文件夹)名称保留的。
<?xml version="1.0" encoding= "utf-8"?>
<openerp>
<data>
<report id="report_ds_repair_template"
name="ds_repair.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"/>
<template id="qweb_ds_repair_template">
<t t-call="report.html_container" >
<t t-foreach ="docs" t-as="o">
<t t-call ="report.external_layout">
<div class="page" >
<div class="oe_structure" />
<h1>Repair Form</h1>
<h2>Test: <span t-field="o.password"/></h2>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>
你的模块文件夹名称是“ds_repair”所以你应该写name="ds_repair.qweb_ds_repair_template"
<report id="report_ds_repair_template"
name="ds_repair.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"
/>
当你想引用另一个时,你有 2 种可能 xml_id。
你写:
<template inherited="module_name.xml_id">
当你想引用另一个模块中的 id 时通常使用此方法
或者你可以
<template inherited="xml_id">
在这种情况下,您想在编写代码的当前模块中引用一个 id。
您的错误来源可能是:
- 您没有名为 ch08 的模块
- 您有一个名为 ch08 的模块,但您在模块中没有 ID "qweb_ds_repair_template"
但我认为在您目前的情况下,您只想参考上面写的 id。
你可以写
<report id="report_ds_repair_template"
name="module_name.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"/>
PS :当我说 module_name 时,它是您的文件夹的名称。
对于我的案例odoo11,在搜索了很多页面之后,看看教程就可以了:
Finally restart Odoo and update the module’s data (to install the template) by going to Settings ‣ Modules ‣ Modules ‣ Academy and clicking Upgrade.
就我而言,我试图配置现有的 Odoo 9 项目。但是,当我在 custom_folder 中克隆模块时。我将其命名为 'odoo_xyz',但是在 openerp.py 中,它被写为 'xyz'。所以我将我克隆的模块重命名为 'xyz',重新启动 Odoo 9,然后创建一个新数据库。因此,它维护了一个新的参考系统。