Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
8846 Tampilan

I have used 'flags': {'initial_mode': 'edit'} to open record in edit mode in Odoo 10.


but its not working in odoo 12. Do we have any alternative of this.

res = {
    'name': action.name,
    'help': action.help,
    'type': action.type,
    'views': [(form_id, 'form')],
    'view_mode': 'action.view_mode',
    'target': action.target,
    'context': action.context,
    'res_model': action.res_model,
    'flags': {'initial_mode': 'edit'},
    'res_id': record.id
}
Avatar
Buang
Jawaban Terbai

Hello 

pass the context like below code and check.

context = dict(self.env.context)
context['form_view_initial_mode'] = 'edit'
return {'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.mass_mailing',
    'res_id': mass_mailing_copy.id,
        'context': context,
}

I hope this will helps you.

Avatar
Buang
Penulis

Worked.Thanks

Jawaban Terbai

Hi,

Send it via the context. This works for me on v12;

return {            'type': 'ir.actions.act_window',            'name': 'Helpdesk Ticket',            'view_type': 'form',            'view_mode': 'form',            'res_model': self._name,            'res_id': self.id,            'context': {'form_view_initial_mode': 'edit'},            'target': 'current',        }
Avatar
Buang
Penulis

thanks for your answer.

Post Terkait Replies Tampilan Aktivitas
2
Feb 23
3631
1
Nov 19
11756
7
Jul 19
4860
0
Feb 21
3022
3
Mar 24
6971