Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4894 Переглядів

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
вер. 21
7159
0
черв. 18
3656
0
бер. 15
4405
0
бер. 15
5531
1
бер. 15
8765