Skip to Content
Menu
This question has been flagged
3 Replies
12782 Views

I have added a Many2Many fields and I want to hide/remove "create" button from popup which is opening while clicking on "Add an item". I want to keep "Select" and "Cancel" option on button click. How can I achieve it? 

Model:

class testclass(models.Model):

    _name = 'test_model'

    test_field= fields.Many2many('test_pbx_grid', column1='pbx_gid', column2='pbx_uid', string='PBX Grid')    


View :

         <record model="ir.ui.view" id="view_pbx_groups_form">

            <field name="name">Group Details</field>

            <field name="model">test_model</field>

            <field name="arch" type="xml">

                <form string="Group Details" >

<field name="test_field"/>

</group>

                    </form>

                 </field>

          </record> 


 

Avatar
Discard
Best Answer

Hi,

Try giving options="{'no_create_edit': True}" with field


<field name="test_field" options="{'no_create_edit': True}"/>

  • no_quick_create - remove the Create and edit... option.
  • no_create_edit - remove the Create "foo" option.
  • no_create - no_quick_create and no_create_edit combined.
  • no_open - in read mode: do not render as a link.

Thanks

Avatar
Discard

you are a real teacher .. thanks

Best Answer

Try giving options="{'no_create_edit': True}" with field

write this code in .xml file

<field name="field_name_ids" options="{'no_create': True}"/>

Avatar
Discard
Best Answer

Hi, 

 only create option  hide like use :

<field name="test_field" options="{'no_create': True}"/>

Avatar
Discard