Reputation: 431
I am at this for hours and can not figure it out. I am trying to print a form from a module I created. I keep getting the below error when I click the print button.
raise ValueError('External ID not found in the system: %s' % (xmlid))
ValueError: External ID not found in the system: ch08.qweb_ds_repair_template
My report.xml file
<?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>
My module folder is called ds_repair. Not sure if I an missing a dependency in my openerp.py so here it is below
{
'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,
}
Upvotes: 1
Views: 4477
Reputation: 2015
In my case, I was trying to configure an existing Odoo 9 project. But, when I clone the module in the custom_folder. I named it 'odoo_xyz', however in the openerp.py, it was written 'xyz'. So I renamed my cloned module to 'xyz', restart Odoo 9 and then create a new database. So, that it maintains a new reference system.
Upvotes: 0
Reputation: 3083
For my case odoo11, after searching many pages, Just look at the tutorial and it works:
Finally restart Odoo and update the module’s data (to install the template) by going to Settings ‣ Modules ‣ Modules ‣ Academy and clicking Upgrade.
Upvotes: 0
Reputation: 1155
You have 2 possibilities when you want to reference another xml_id.
You write:
<template inherited="module_name.xml_id">
This method's generally used when you want to reference an id in another module
Or you can
<template inherited="xml_id">
In this case, you would like to reference an id in the current module where your code is written.
The origin of your error can be:
But I think in your current situation you just would like to reference the id write above.
You can write
<report id="report_ds_repair_template"
name="module_name.qweb_ds_repair_template"
model="ds.repair"
string="Repair Form"
report_type="qweb-pdf"/>
PS : When I say module_name, it's the name of your folder.
Upvotes: 1
Reputation: 1631
your module folder name is "ds_repair" so you should write 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"
/>
Upvotes: 1
Reputation: 3378
Not sure but I think the ch08 in place of ds_repair is causing the issue. I am pretty sure text preceding the dot is reserved for the namespace or addon ( addon folder ) name.
<?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>
Upvotes: 0