跳至内容
菜单
此问题已终结
2 回复
16415 查看

Hello, I would like to know how to open a form with an existing record in Edit mode.  The form is called when I return a dictionary from a method like this:

return {
            'name': 'Name',
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': 100,
            'res_model': 'sale.order.line',
            'res_id': 1,
            'type': 'ir.actions.act_window',
            'context': context,
        }

Is there another key I can assign with some value that opens this form in Edit mode?

形象
丢弃
最佳答案

For Odoo 11 

'context': {'form_view_initial_mode': 'edit', 'force_detailed_view': 'true'},
形象
丢弃

This worked for me in Odoo 13

Great, this worked for me in Odoo 14

最佳答案

Hi!

 

return {
            'name': 'Name',
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': 100,
            'res_model': 'sale.order.line',

            'target: 'inline',

            'res_id': 1,
            'type': 'ir.actions.act_window',
            'context': context,
        }

More information in: openerp-apps.blogspot.mx

 

形象
丢弃
相关帖文 回复 查看 活动
1
3月 15
3184
0
8月 23
1743
0
12月 19
6304
1
3月 15
9937
1
3月 15
6784