Odoo Help

Welcome!

This community 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.

0

Why openERP don't find my custom View ?

By
justeUnPseudo
on 6/27/13, 8:06 AM 2,466 views

Hi,

I try to create a custom view in OpenERP V6.1. I've found few documentation online and i learn looking form existing view like ganttView, etc... but i've got a problem, openERP don't see my view.

validation error: value custom in not for the field "ir_ui_view.type" is not in selection.

Sources:

static/src/xml/customView.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
    <t t-name="custom">
    <HTML> 
    <BODY>
    <h1>custom View</h1>
    </BODY> 
    </HTML> 
    </t>
</templates>

static/src/js/script.js

openerp.myaddons = function (openerp){   
    openerp.web.views.add('custom', 'openerp.myaddons.CustomView');

openerp.myaddons.CustomView = openerp.web.View.extend({
    display_name: 'custom',
    template: "custom",

    init: function() {
    this._super.apply(this, arguments)
    alert('load')
    },

    start: function() {
    alert("start custom")
    },
})

myaddonsView.xml

           <!-- VUES -->
    <record model="ir.ui.view" id="myaddons_module_custom">
        <field name="name">myaddons.module.custom</field>
        <field name="model">myaddons.module</field>
        <field name="type">custom</field>
    </record>    

    <!-- ACTIONS -->
    <record model="ir.actions.act_window" id="action_myaddons_module">
        <field name="name">Aff</field>
        <field name="res_model">myaddons.module</field>
        <field name="view_type">form</field>
        <field name="view_mode">form, custom</field>
    </record>

Thanks for your help, and if you have some tutorials or simple example don't hesitate ;)

EDIT:

__openerp__.py

{
    'name': "my module",
    'author': "truc",
    'category' : '',
    'description':'a module',
    'version': "1.0",
    'depends': ['web','base_setup'],
    'js': [ 'static/src/js/*' ],
    'qweb' : [  'static/src/xml/*'],
    'update_xml': ['myaddonsView.xml'],
    'installable': True,
    'auto_install': True,
}
0

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 6/27/13, 8:08 AM

There is your xml file in the __openerp__ file?

yes, the xml and js file 'qweb' : [ 'static/src/xml/'], 'js': [ 'static/src/js/' ]

justeUnPseudo
on 6/27/13, 8:10 AM
0
antoine
On 8/29/14, 6:02 AM

Same name template in your .js and .xml ?
 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/27/13, 8:06 AM
Seen: 2466 times
Last updated: 3/16/15, 8:10 AM