1
votes

I need to remove the create button in kanban view which found in "Sales/Customers" as in below image

enter image description here

1

1 Answers

2
votes

In your kanban declaration add create="false" just like you see below.

<kanban create="false">

You can just go into settings->user interface->views and edit this directly. You also may be able to activate developer mode by clicking on your username (in the top right of the screen v8 or he little question mark v9+) and select About Odoo then activate developer mode. From there you should also be able to edit the form view (if you have admin authority).

You can also create an addon which modifies this view using xpath. Similar to this.

    <record model="ir.ui.view" id="modified_partner_form_view">
        <field name="name">partner.modified</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <xpath expr="//kanban" position="attributes">
                    <attribute name="create">false</attribute>
            </xpath>
        </field>
    </record> 

Note: setting create to false should work however using the webconsole did not allow me to add the attribute to the kanban tag. I am not sure why, it should work but in my installation would not. The xpath method should work, I have used it to modify other attributes however have not tested with this kanban create attribute. If someone knows why this might not work please comment. Thanks