Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
9901 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 9 23
5131
2
thg 6 20
3984
1
thg 10 22
8042
0
thg 2 22
1689
0
thg 9 15
4272