I have a button in a form, that calls an object method returning a Window Action dictionary.
Clicking on it, it opens a new form, as desired. This form opens in View mode.
Is it possible to make it open in Edit mode ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I have a button in a form, that calls an object method returning a Window Action dictionary.
Clicking on it, it opens a new form, as desired. This form opens in View mode.
Is it possible to make it open in Edit mode ?
Hi,
Pass form_view_initial_mode as edit in the context.
Sample:
def action_duplicate(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id("account.action_move_journal_line")
action['context'] = dict(self.env.context)
action['context']['form_view_initial_mode'] = 'edit'
action['context']['view_no_maturity'] = False
action['views'] = [(self.env.ref('account.view_move_form').id, 'form')]
action['res_id'] = self.copy().id
return action
See: How To Open Form View In Edit Mode From Python Code Odoo
Thanks
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
1
mrt. 15
|
4286 | ||
|
3
mrt. 15
|
5923 | ||
Form Sheet width
Opgelost
|
|
8
mei 16
|
33953 | |
|
1
mei 15
|
3991 | ||
|
1
mrt. 15
|
17790 |
See http://help.openerp.com/question/3447/closed-open-a-form-in-a-specified-state-editbrowse/