Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
471 Tampilan

I'm trying to figure out which permission or access right controls the visibility of the "Add Properties"option in the action menu on CRM lead/opportunity forms Odoo17 Community.

  • The option is visible to both Admin and Sales users.
  • I've tried adjusting various access rights and security settings, but none of them seem to hide this action.

Does anyone know which specific permission or group is responsible for showing the "Add Properties" action? I'd like to remove or restrict it for users, but I can't find the right setting. 

Avatar
Buang
Penulis

i tried hiding Add Properties using custom module js file code to remove menu action, but that too not working.
patch(FormController.prototype, {
getStaticActionMenuItems() {
const items = this._super();

// Remove 'Add Properties' if it exists
if (items.addPropertyFieldValue) {
delete items.addPropertyFieldValue;
}

return items;
},
});

Penulis Jawaban Terbai


import { patch } from "@web/core/utils/patch";
import { FormController } from "@web/views/form/form_controller";
patch(FormController.prototype, {
    async getStaticActionMenuItems() {
        const items = await super.getStaticActionMenuItems();
        if (items?.addPropertyFieldValue) {
            console.log("Removing 'Add Properties'");
            delete items.addPropertyFieldValue;
        }    return items;
    },
});

This custom module js patch worked for Odoo17 to hide add properties action menu

Avatar
Buang
Jawaban Terbai

In Odoo 17, the "Add Properties" option usually appears when developer mode is enabled. It allows users to attach technical fields (like x_studio fields or properties) directly to records. If you want to hide or disable this option, here are a few things you can do:

✅ Solution:

  1. Turn Off Developer Mode:
    • The "Add Properties" option only shows when developer mode is on.
    • If you're a regular user and don’t need it, turning off developer mode will remove the option.
  2. Use Web Assets (Custom JS) to Hide It:
    • If you want to hide it for all users or even in dev mode, you can use JavaScript.
    • Add this code in your custom module:
  3. Limit Access with User Groups (Advanced):
    1. If your users have technical access, consider creating a user group without access to developer features.



Avatar
Buang

More LLM / AI - this is not a solution.

Jawaban Terbai

Hii,

Modify the View XML Based on User Groups

The most effective and cleanest solution is to control the visibility of the "Add Properties" action using the XML view and the groups attribute. This will ensure that the action is visible only to specific user groups (like Sales Manager) and hidden for others.

Steps to Modify the View:
  1. Identify the View: Find the XML view for the CRM lead/opportunity form (crm.lead.form), where the "Add Properties" button or action is defined.
  2. Modify the View:
    • Go to SettingsTechnicalUser InterfaceViews.
    • Search for crm.lead.form.
    • Look for the <button> or <menu> entry related to "Add Properties" or similar.
  3. Add the groups Attribute
  4. :
    • Modify the button or menu entry to make it visible only to specific groups (e.g., Sales Manager).

<button name="add_properties" type="object" string="Add Properties" groups="base.group_sale_manager"/>

  1. In this example, the button will only be visible to users in the Sales Manager group (base.group_sale_manager).
  2. Save and Update the Module:
    • After modifying the view, restart Odoo and update your module to apply the changes.

This approach directly modifies the visibility of the "Add Properties" button in the CRM lead/opportunity form, making it visible only to the selected user group(s).

2. Adjust User Groups and Permissions

You also need to ensure that only the appropriate user groups have access to the relevant permissions. Here’s how:

Steps to Adjust User Groups:
  1. Go to Users & Companies:
    • Go to SettingsUsers & CompaniesUsers.
    • Select the user for whom you want to restrict access to the "Add Properties" action.
  2. Modify the User’s Groups:
    • Check the User Groups tab for the selected user.
    • Ensure that the user is not part of the Sales Manager group (base.group_sale_manager), unless you want to give them access.
    • You can assign the user to a group like Sales User (base.group_sale_user) if you want to restrict access to certain features.
  3. Adjust the Group Permissions:
    • Sales Manager typically has more permissions, including managing properties. If you want to restrict access, ensure the user is assigned to a group with limited permissions, such as Sales User.
    • You can also create custom user groups with specific permissions for greater control.

i hope it is use full

Avatar
Buang

No it's not! Seems to come from LLM / AI.

Penulis

This Won't work for Add Properties

Post Terkait Replies Tampilan Aktivitas
1
Feb 23
4071
3
Jul 25
8642
1
Mei 25
1059
0
Jan 25
908
1
Des 24
1378