Hello everyone! I'm currently working on customizing a form view in Odoo, and I'm facing an issue while trying to add a custom button next to the 'Create' button. I've attempted to use expressions and different positioning methods, but unfortunately, it's not working as expected.
Here's the code snippet I've tried so far: code snippet 1
Although this code snippet works, it places the custom button inside the form instead of next to the menu button. The button appears within the header section of the form. However, my goal is to have the custom button positioned directly beside the 'Create' button in the form's header. I also tried using as follows, but it resulted in an error since the button couldn't be located: code snippet 2
Extend the FormView.buttons template to add your custom button and override the render_button function to add the click ( Extend the
FormView
and usejs_class
on theform
tag)Extend the web template:
Create a custom form controller:
Add the files to the manifest file:
Set the
js_class
attribute on the form view tag: