How to Open a Form View on Button Click in Odoo 17

CelineGeorge1 872 views 11 slides Aug 07, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

In this slide, we'll show you how to activate a form display as you press a button. We can return the view we need to access in this way, on the button action.


Slide Content

How to Open a Form View on Button Click in Odoo 17 Enterprise

Introduction Enterprise In this slide, we'll show you how to activate a form display as you press a button. We can return the view we need to access in this way, on the button action.

Enterprise Create a python file to specify the button and a xml file for inheriting the button Let's check with an example

Enterprise Consider, we need to open a form view for entering the valuation of fleet on a button click.

Enterprise In python file, specify the button action

Enterprise In XML file, inherit the button in fleet

Enterprise Specify the form view for new model ‘fleet.valuation.report’

Enterprise Specify the action for the form view ‘fleet.valuation.report’

Enterprise After upgrading the custom module, we can view the button ‘Valuation Report’ in fleet form view

Enterprise On clicking, the form view for the valuation report will be visible

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com