Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
24702 Vizualizări

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',
    },
....

Imagine profil
Abandonează
Cel mai bun răspuns

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
}
Imagine profil
Abandonează
Cel mai bun răspuns

I have the same problem.

Even I tried "module_load" but not work.

@odoo Supporter, please help me a bit.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 20
4942
2
dec. 16
10945
1
aug. 15
10396
2
iun. 24
22386
1
iul. 19
3104