Odoo Help

0

How is Qweb2 can not find and load templates?

By
emily
on 4/26/15, 3:32 AM 1,327 views

Below are my codes, I've uninstalled nd re-installed it, still the browser reports this error: Uncaught Error: QWeb2: Template 'ProductFlangeView' not found. Anything I did wrong?


__openerp__.py

{
    'name' : 'Flange',
    'version' : '1.0.0',
    'author' : 'Emily Yu',
    'category' : 'Custom',
    'website' : '',
    'description': """
    """,
    'depends' : ['product'],
    'data':[
        'security/ir.model.access.csv',
        'views.xml'
    ],
    'qweb': [
        'static/src/xml/product_flange.xml'
    ],
    'installable': True,    
}


product_flange.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- vim:fdl=1:
-->
<templates id="template" xml:space="preserve">
    <t t-name="ProductFlangeView">
        <t t-extend="product.flange">
		    <t t-jquery="body" t-operation="append">
		        <div>text</div>
		    </t>
		</t>            
    </t>
</templates>


widget.js

var flange = openerp.Widget.extend({
    template: 'ProductFlangeView',
    events: {
        // events binding example
        'change select': 'get_selection',
    },
....

0

Axel Mendoza

--Axel Mendoza--
11831
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 4/19/17, 1:18 AM

I face this today and the cause is the moment that the template is trying to be used by the widget and is not loaded yet, perhaps you could execute your widget instantiation until the modules are loaded like this:

instance.session.on('module_loaded', this, function () {
//here
}

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/26/15, 3:32 AM
Seen: 1327 times
Last updated: 4/19/17, 1:18 AM