i want to hide button create
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hello,
In settings >> access rights, You can remove the create access for particular group/user.
shivoham.odoo@gmail.com
You can hide create button in res partner from all users by overriding the form, kanban and tree view as below:
<!-- Hide create button from Kanban View -->
<record id="res_partner_kanban_view_hide_create" model="ir.ui.view">
<field name="name">res.partner.kanban.inherit.hide.create</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="create">0</attribute>
</xpath>
</field>
</record>
<!-- Hide create button from Tree View -->
<record id="res_partner_view_tree_inherit_hide_create" model="ir.ui.view">
<field name="name">res.partner.view.tree.inherit.hide.create</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="create">0</attribute>
</xpath>
</field>
</record>
<!-- Hide create button from Form View -->
<record id="view_partner_form_inherit_hide_create" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit.hide.create</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="create">0</attribute>
</xpath>
</field>
</record>
thank you bro but i can with security ???
You can create your own group and then add the group to the above override view so any user in this group will not able to see the create button.
Create security group:
<record id="group_hide_partner_create_button" model="res.groups">
<field name="name">Hide Partner Create Button</field>
</record>
Then add the groups to all above overidded views, for example the form view:
<record id="view_partner_form_inherit_hide_create" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit.hide.create</field>
<field name="model">res.partner</field>
<field name="groups_id"
eval="[(4,ref('[YOUR_CUSTOM_MODEUL_NAME].group_hide_partner_create_button'))]"/>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="create">0</attribute>
</xpath>
</field>
</record>
thnak you
please its possible to hide button create with file ir.model.access.csv ??
exemple:
access_res_partner_user,_es_partner_user,base.model_res_partner,YOUR_CUSTOM_MODEUL_NAME.group_hide_partner_create_button,1,0,0,0
Yes, you can remove the create access from Access Rights in Settings after enabling developer mode
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
Apr 24
|
994 | ||
|
0
May 24
|
46 | ||
|
1
Apr 24
|
1822 | ||
|
4
Sep 23
|
3074 | ||
|
2
Sep 23
|
5592 |