Skip to Content
Menu
This question has been flagged
1 Reply
9013 Views

How can I add a button to the right-hand column within a form view? For example, I am extending the sale order form view with the following fields:

<xpath expr="//div[@name='carrier_selection']" position="after">

            <field name="x_shipping_method_id" options="{'no_create': True, 'no_open': True}"/>

            <field name="x_shipping_cost"/>

            <field name="x_staff_notes" attrs="{'invisible': [('x_staff_notes', '=', False)]}"/>

            <field name="x_custom_products" attrs="{'invisible': [('x_custom_products', '=', False)]}"/>

            <field name="x_is_custom_products_acknowledged" invisible="1"/>

            <button name="434" type="action" string="Acknowledge Custom Products" class="oe_highlight" attrs="{'invisible': ['|',('x_custom_products', '=', False),'&amp;',('x_custom_products', '!=', False), ('x_is_custom_products_acknowledged', '=', True)]}"/>

          </xpath>


This results in the new fields being added in a grid with the labels on the right, and the values on the left. I want the button element to be added to the right-hand column of this grid. Currently it gets placed beneath the labels, in the left-hand column, but I would like it underneath the values, in the right-hand column. Is this possible with Odoo?

Avatar
Discard
Best Answer

 Use oe_button_box in class (You may use class="pull-right" with that)


 <div class="oe_button_box" name="button_box">

                        <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">

                            <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>

                        </button>






Avatar
Discard
Related Posts Replies Views Activity
5
Aug 24
42974
2
Apr 24
948
3
Jun 23
3128
2
Jun 23
2374
3
Mar 23
8622