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

Can i use ORM methods like create or write to edit fields like a one2many or a reference one? How would i access them?

Let's say i want to create a function that when called creates a new menu, but the menu must have referenced action that is made up of a selection field wich then becomes a many2one, right? How would i call this many2one? Should i set first the selection with create then edit the many2one with write?

 Menu.create(cr, uid, {'name':menu_name, 'parent_id': parent_id[0],
                                        'icon': 'STOCK_JUSTIFY_FILL',
                                        'sequence': 2,
                                        'action': '[ir.actions.act_window]'} , context=None)
new_menu_ids = Menu.search(cr, uid, [('name','=','menu_name')], limit=1, context=None)
Menu.write(cr, uid, new_menu_ids[0], {'action':action_wanted.id}, context=None)

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 9 21
7159
0
thg 6 18
3661
0
thg 3 15
4425
0
thg 3 15
5536
1
thg 3 15
8778