Odoo Help


How to create a new view type?

on 7/13/13, 1:09 AM 2,361 views

I want to create a new view type, named 'styled', to show an object in a "stylized" way. To be more specific, it's a questionnaire which must be completed on-line and must hide openerp structure for final user.

Following the "Developing OpenERP Web Addons" document, I created the js file to describe the new view using "instance.web.View.extend", the qweb template, and a registry "ir.ui.view" to associate the view to the model.

But when I test the addon the following error happens:

'The value "styled" for the field "ir_ui_view.type" is not in the selection'

I guess it's because I'm not declaring the view in python, in the server side. Could it be possible? I expect another error in the arch field because I don't know how fill it.

do you have resolved this? I have the same problem...

Stefan Reisich
on 3/26/15, 2:01 PM

Stefan Reisich

--Stefan Reisich--
Stefan Reisich
| 7 7 8
Pfungstadt, Germany
--Stefan Reisich--
Stefan Reisich
On 3/27/15, 6:12 AM

I have found the solution:

I just added my own type to the selection field of ir.ui.view:

api v8:

class view(models.Model):
    _name = 'ir.ui.view'
    _inherit = 'ir.ui.view'
type = fields.Selection(selection_add=[('assignment', 'Assignment')])
    # in your case you should replate ('assignment', 'Assignment') with ('styled', 'Styled or another name...')

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


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)


Asked: 7/13/13, 1:09 AM
Seen: 2361 times
Last updated: 11/1/15, 7:07 AM