Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
8822 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

Worked.Thanks

Beste antwoord

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
Annuleer
Auteur

thanks for your answer.

Gerelateerde posts Antwoorden Weergaven Activiteit
2
feb. 23
3597
1
nov. 19
11726
7
jul. 19
4843
0
feb. 21
3012
3
mrt. 24
6933