web mailing list archives
web@odoo-community.org
Browse archives
Re: [OCA/web] [12.0][IMP] web_widget_color: Allow non-required fields (#1270)
Re: [OCA/web] [11.0][ADD] web_view_calendar_list (#1512)
How-to close a Formview ?
by
DEC, Yann Papouin
Hello everyone,
I'm looking for a way to close a form opened after clicking on a line of a list/tree from a many2many field from Odoo 12.
In that purchase.order.line form, I added two buttons to delete (unlink) this line but I'm doing specific actions before this, like canceling attached moves.
Since this line will not exist anymore in the database after clicking the button, I'm returning an 'ir.actions.act_view_reload' to refresh the purchase.order but I'm still trying to close the current opened form.
I tried to add
data-dismiss="modal" to my button to use the bootstrap-like behaviour. But it works only if there is no confirm dialog and the button is not in header or footer.
I also tried to return 'ir.actions.act_window_close' but it is not doing anything for Formviews.
I know that I could extend Formview from a custom js module but I know nothing about the js-part of the odoo framework and I'm not a javascript developer. I tried to find a reference about the currently opened Formview in ActionManager to close it manually but I didn't find anything.
Maybe one of you could guide me to the right direction ?
Cordialement,
Yann Papouin.
PAPOUIN
Yann Ingénieur R&D y.papouin@dec-industrie.com https://www.dec-groupe.fr https://www.dec-industrie.com |
|