Hi,
To make changes to the buttons or to add new buttons, you have to modify the XML code of the view.
For that, you need to enable debug mode. Then select the 'Edit View: Form' option from the debug options. You can see the main view. Navigate to the 'Inherited Views' tab and click on Add a line. A new form will be opened, where you can add the new button/ make changes to the new button by inheriting the existing view.
Provide a 'View Name' and select the current form view(The view from which the button is added(Either the parent view or any of its inherited view)) as 'Inherited View'. Then add the code in the text box under the 'Architecture' tab. For example:
<?xml version="1.0"?>
<data>
<xpath expr="//button[@name='existing_button_1']" position="replace">
<button name="replace_button_function" type="object" class="btn-primary" string="Updated Button"/>
</xpath>
<xpath expr="//button[@name='existing_button_2']" position="after">
<button name="new_button_function" type="object" class="btn-primary" string="New Button"/>
</xpath>
</data>
You have to add the changes in XML code in either a new inherited view or in the inherited view created by Odoo for Studio customizations(Preferred): The External ID starts with studio_customization.odoo_studio_. Don't modify the other existing views.
Regards
Thanks, but with the Sales module, I don't see where the create invoice button is liked. When I found his action (Settings > Technical > Actions) There's nothing but the type. No code that tell me how it's create a new invoice into the Accounting module.
Cause I'm looking for adding autofill data. Is it possible ?