Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7159 Vizualizări

I want to open a form view in a popup but not in editable mode. The form view should be in saved mode and not in edit mode.

Normally when we open a form in a popup, it always shows the popup in editable mode.

def action_view_product(self):
return {
'type': 'ir.actions.act_window',
'name': 'Products',
'view_mode': 'form',
'view_type': 'form',
'res_model': "product.template",
'res_id': self.id,
'target': 'new',
}


Imagine profil
Abandonează
Cel mai bun răspuns

Pass 'flags': {'initial_mode': 'view'} in the action to open the form in non-edit mode.

Try the following code:

return {
'type': 'ir.actions.act_window',
'name': 'Products',
'view_mode': 'form',
'view_type': 'form',
'view_id': view.id,
'res_model': "product.template",
'res_id': self.id,
'target': 'new',
'flags': {'initial_mode': 'view'}
}


Imagine profil
Abandonează
Autor

Thanks! It worked :)

Related Posts Răspunsuri Vizualizări Activitate
1
aug. 25
197
1
aug. 25
87
0
aug. 25
123
1
aug. 25
302
3
aug. 25
300