Skip to content

Master Odoo 17: Seamlessly Hide Kanban Plus Button for Enhanced Control

odoo 17 kanban hide plus

Are you an Odoo 17 user or developer looking to fine-tune your Kanban views for a more controlled and streamlined user experience? Specifically, do you find the “plus” button for quick record creation in your Kanban stages to be, at times, more of a hindrance than a help? If so, you’re in the right place! This comprehensive guide will walk you through the precise steps to Odoo 17 Hide Kanban Plus button, empowering you with greater control over your Odoo environment.

This tutorial is inspired by a common query from the Odoo community, as showcased in the video “Vibe Coding Tipis2 Custom Odoo Kanban” available here. We’ll build on the solution identified in that context, providing a detailed, step-by-step approach to implement this customization effectively.

The Challenge: Unwanted Quick Creation and the Need to Odoo 17 Hide Kanban Plus

Odoo’s Kanban view is a powerful tool for visualizing workflows and managing tasks, projects, and various records. Its intuitive drag-and-drop functionality and quick-add features make it incredibly efficient for many scenarios. One such feature is the “plus” button found within each Kanban stage (or column), which allows users to instantly create a new record (e.g., a new task, a new sales order line, a new lead) within that specific stage.

While convenient for rapid data entry, this quick-create functionality isn’t always desirable. In many business contexts, uncontrolled record creation can lead to:

  • Data Integrity Issues: Users might create incomplete or erroneous records without proper validation or mandatory field completion.
  • Workflow Bypass: Critical steps or approvals in the record creation process might be skipped, leading to non-compliance or operational inefficiencies.
  • Cluttered Data: Unnecessary or duplicate records can accumulate, making it harder to manage and analyze accurate data.
  • User Experience Confusion: For certain user groups, a simplified interface with fewer options can be less overwhelming and reduce potential errors.
  • Specific Business Rules: Some organizations have strict rules about how and when records can be created, requiring a more formal process than a simple “plus” button allows.

For these reasons, the ability to Odoo 17 Hide Kanban Plus button becomes a crucial customization. It allows administrators and developers to enforce specific workflows and ensure that records are created through predefined forms, ensuring data quality and adherence to business logic. By disabling this quick-add button, you guide users towards the proper channels for creating new entries, thereby improving overall system governance and user experience.

Prerequisites for Hiding the Kanban Plus Button

Before we dive into the technical steps, ensure you have the following:

  • Odoo 17 Environment: A running instance of Odoo version 17.
  • Developer Mode Enabled: Access to Odoo’s developer mode (usually activated from the “Settings” dashboard or by adding ?debug=1 to your URL). This is essential for inspecting views and identifying their XML IDs.
  • Basic Odoo Development Knowledge: Familiarity with Odoo modules, XML views, inheritance, and the manifest file (__manifest__.py).
  • Access to Custom Module Development: The ability to create or modify custom Odoo modules.
  • Text Editor/IDE: A code editor like VS Code, PyCharm, or Sublime Text for writing your XML and Python code.

Step-by-Step Guide: How to Odoo 17 Hide Kanban Plus Button

This tutorial follows a structured approach, starting from identifying the target view to deploying your changes.

Step 1: Understanding the quick_create Attribute in Odoo 17 Kanban

The “plus” button for quick record creation in Odoo’s Kanban view is controlled by an attribute called quick_create. When this attribute is set to true (or 1, which is the default behavior if the attribute is not specified), the button appears. When set to false (or 0), the button is hidden. Our goal is to override the default behavior for specific Kanban views using an Odoo view inheritance mechanism.

The Odoo framework intelligently uses this attribute. Internally, JavaScript code checks the value of quick_create on the Kanban view’s definition. If quick_create is 0, the logic that renders the “plus” icon for adding records is simply skipped, effectively making the button invisible to the user. This is a clean and intended way to manage this functionality without resorting to complex CSS hacks or overriding core JavaScript.

Step 2: Identifying the Target Kanban View to Modify

The first crucial step is to determine which specific Kanban view you want to modify. The “plus” button appears in various Kanban views across different Odoo modules (e.g., Project Tasks, CRM Leads, Sales Order Lines).

  1. Navigate to the Kanban View: Go to the Odoo application where the Kanban view you want to modify is located (e.g., Project > Tasks, then switch to Kanban view).
  2. Activate Developer Mode: Ensure developer mode is active.
  3. Open Developer Tools: Click on the “bug” icon (Developer Tools) in the top-right corner of Odoo.
  4. Inspect View Metadata: From the Developer Tools menu, select “Edit View: Kanban” (or similar, depending on the view type). This will open a window displaying the view’s metadata.
  5. Locate the External ID: In the “External ID” field, you’ll find the unique XML ID of the Kanban view. It typically looks like module_name.xml_id_of_view (e.g., project.view_task_kanban for the Project Task Kanban view). Make a note of this ID; you’ll need it for your inheritance.

This external ID is vital because it acts as the reference point for your custom module to inherit and modify the original view. Without the correct inherit_id, your customization won’t be applied to the desired view.

Step 3: Setting Up Your Custom Odoo Module

If you don’t already have a custom module where you want to place this customization, you’ll need to create one. This is best practice for keeping your modifications separate from Odoo’s core code, making upgrades and maintenance much smoother.

  1. Create a New Directory: Inside your Odoo custom add-ons path (e.g., odoo/custom_addons/), create a new directory for your module (e.g., my_custom_module).
  2. Create the Manifest File (__manifest__.py):
    # my_custom_module/__manifest__.py
    {
        'name': 'Custom Kanban Enhancements',
        'version': '1.0',
        'category': 'Extra Tools',
        'summary': 'Module to provide various Kanban customizations.',
        'author': 'Your Name/Company',
        'website': 'https://yourwebsite.com',
        'depends': ['base', 'project'], # Add dependencies based on the view you're modifying (e.g., 'project' for tasks)
        'data': [
            # XML files will be added here later
        ],
        'installable': True,
        'application': False,
        'auto_install': False,
        'license': 'LGPL-3',
    }
    
    • Important: The depends list should include the module that defines the original Kanban view you are inheriting. For example, if you’re modifying the Project Task Kanban, you need project in your dependencies.
  3. Create an __init__.py File:
    # my_custom_module/__init__.py
    # This file can be empty for simple view inheritance
    
  4. Create a views Directory: Inside my_custom_module, create a directory named views. This is where your XML view inheritance file will reside.

By following these steps, you establish a solid foundation for your customizations, ensuring they are modular and easy to manage. This approach is fundamental for any developer looking to implement changes like Odoo 17 Hide Kanban Plus or any other UI/UX modifications.

Step 4: Crafting the Inheritance XML to Odoo 17 Hide Kanban Plus

Now, let’s create the XML file that will perform the actual modification. This file will inherit the original Kanban view and inject the quick_create="0" attribute.

  1. Create an XML File: Inside your my_custom_module/views/ directory, create a new XML file (e.g., hide_kanban_plus_button.xml).
  2. Add the Inheritance Code: Insert the following XML structure into your hide_kanban_plus_button.xml file. Remember to replace placeholders with your specific module name and the original view’s XML ID.
<odoo>
    <data>
        <record id="my_custom_module_kanban_quick_create_disable" model="ir.ui.view">
            <field name="name">Disable Quick Create in Kanban - Custom</field>
            <field name="model">project.task</field> <!-- Replace with the actual model of your Kanban view (e.g., project.task) -->
            <field name="inherit_id" ref="project.view_task_kanban"/>  <!-- Replace with the XML ID of the original Kanban view (from Step 2) -->
            <field name="arch" type="xml">
                <xpath expr="//kanban" position="attributes">
                    <attribute name="quick_create">0</attribute>
                </xpath>
            </field>
        </record>
    </data>
</odoo>

Detailed Explanation of the XML:

  • <record id="my_custom_module_kanban_quick_create_disable" model="ir.ui.view">: This defines a new view record.
    • id: A unique identifier for your inherited view. It’s crucial for Odoo to recognize and apply your changes. Using your module’s name as a prefix (my_custom_module_...) is a good convention.
    • model="ir.ui.view": Specifies that this record defines a view.
  • <field name="name">Disable Quick Create in Kanban - Custom</field>: A descriptive name for your inherited view, helpful for identification within Odoo’s technical settings.
  • <field name="model">project.task</field>: This field specifies the model (e.g., project.task, crm.lead, sale.order.line) that the Kanban view operates on. Ensure this matches the model of the original view you are inheriting.
  • <field name="inherit_id" ref="project.view_task_kanban"/>: This is the core of the inheritance.
    • inherit_id: Points to the original view you want to modify.
    • ref="project.view_task_kanban": Contains the external XML ID you identified in Step 2. This tells Odoo exactly which view to apply your changes to.
  • <field name="arch" type="xml">: This field holds the actual view architecture modifications.
    • <xpath expr="//kanban" position="attributes">: This is an XPath expression, a powerful way to target specific elements within an XML structure.
      • expr="//kanban": Selects the root <kanban> element within the inherited view. The // signifies a search throughout the entire XML tree.
      • position="attributes": Instructs Odoo to add or modify attributes of the element found by the expr.
    • <attribute name="quick_create">0</attribute>: This is the critical line. It sets the quick_create attribute of the <kanban> element to 0 (false), which disables the quick-add “plus” button. By setting this value, you successfully implement the goal to Odoo 17 Hide Kanban Plus.

Step 5: Updating Your Module’s Manifest File

After creating your XML file, you must tell Odoo about it by adding it to your custom module’s manifest file (__manifest__.py).

  1. Edit __manifest__.py: Open your my_custom_module/__manifest__.py file.
  2. Add XML File to data List: Add the path to your new XML file in the data list.
# my_custom_module/__manifest__.py
{
    'name': 'Custom Kanban Enhancements',
    'version': '1.0',
    'category': 'Extra Tools',
    'summary': 'Module to provide various Kanban customizations.',
    'author': 'Your Name/Company',
    'website': 'https://yourwebsite.com',
    'depends': ['base', 'project'], # Ensure 'project' (or relevant module) is here
    'data': [
        'views/hide_kanban_plus_button.xml', # Add this line
    ],
    'installable': True,
    'application': False,
    'auto_install': False,
    'license': 'LGPL-3',
}

This step ensures that Odoo loads and processes your view inheritance when your module is installed or updated. Without this, your changes will not take effect.

Step 6: Installing or Upgrading Your Custom Module in Odoo

Once your files are in place, you need to apply these changes within your Odoo instance.

  1. Restart Odoo Server: If you’re running Odoo from the command line, restart your Odoo server to ensure it recognizes the new module or changes to existing module files.
  2. Update Module List: In your Odoo instance, navigate to the “Apps” module.
    • If you created a new module, you might need to click “Update Apps List” first (found under the “Update” button in Odoo 17) to make your new module visible.
  3. Install/Upgrade Your Module:
    • For a new module: Search for “Custom Kanban Enhancements” (or whatever you named your module). Click “Install.”
    • For an existing module: Search for your custom module. If it’s already installed, click “Upgrade.” This will re-process its data files, applying your view inheritance.

Step 7: Verifying the Odoo 17 Hide Kanban Plus Implementation

The final and most satisfying step is to confirm that your customization works as expected.

  1. Navigate to the Modified Kanban View: Go back to the specific Kanban view you modified (e.g., Project > Tasks, then Kanban view).
  2. Observe the Changes: The “plus” button within each Kanban stage (the one for quick record creation) should now be completely hidden. If it’s gone, congratulations! You’ve successfully managed to Odoo 17 Hide Kanban Plus button.
  3. Test Functionality: Attempt to create new records through the standard “Create” button usually located at the top of the Kanban view or by navigating to the form view. This should still work, as your change only affects the quick-add button, not the general ability to create records.

Advanced Considerations and Best Practices

While the method described above is highly effective for a global disablement of the quick-add button, there are additional considerations for more complex scenarios:

  • Conditional Hiding (Access Rights / Record Rules):

    If your requirement is to hide the “plus” button only for specific users or under certain conditions (e.g., only project managers can quick-create), a simple view inheritance might not be enough. You would need to combine this with Odoo’s robust access rights or record rules system.

    • Access Rights: Define groups and assign specific create permissions. If a user doesn’t have create access, the “plus” button (and the main “Create” button) will typically disappear automatically.
    • Record Rules: Create rules that restrict the creation of records based on certain criteria (e.g., only allow creation of tasks for projects where the user is a follower). This can indirectly affect quick creation.
    • Programmatic Control (JS Override): For highly dynamic conditions, you might need to override the Kanban controller’s JavaScript directly to add custom logic that checks user groups or specific record data before rendering the quick_create button. This is a more advanced technique and requires a deeper understanding of Odoo’s frontend framework.

    For more on advanced Odoo development, consider exploring official Odoo documentation or resources like Odoo’s Developer Documentation.

  • Impact on User Experience:

    Always consider the end-users. Hiding the “plus” button can simplify the interface and enforce workflows, but it might also add a few extra clicks for users accustomed to quick creation. Communicate these changes clearly to your users. A good user experience often balances efficiency with control.

  • Maintenance Across Odoo Updates:

    Odoo is continuously evolving. While quick_create is a well-established attribute, future Odoo versions might introduce changes to view structures or attribute names. Always test your custom modules thoroughly after performing an Odoo upgrade to ensure compatibility. The beauty of the inheritance mechanism is that it’s generally quite resilient to minor changes.

  • Alternatives (CSS/JavaScript):

    While possible to hide the button using CSS (display: none;) or JavaScript manipulations on the frontend, using the quick_create="0" attribute is the preferred and most robust method. It leverages Odoo’s intended framework for controlling this functionality and is less prone to breaking with future updates compared to purely visual hacks. The quick_create attribute directly influences the rendering logic, which is superior to merely hiding an already rendered element.

  • Internal Links and Related Features:

    Consider if hiding this button impacts other parts of your Odoo setup. For instance, if you have automated processes that rely on quick-created records, ensure they are still triggered when records are created through the standard form. Review your company’s specific Odoo configurations and workflows to ensure seamless integration. For example, understanding Odoo’s ORM and database interactions can help in troubleshooting any related issues.

Conclusion: Gaining Precision and Control in Odoo 17

Successfully implementing Odoo 17 Hide Kanban Plus is a significant step towards a more controlled, efficient, and user-friendly Odoo environment. By following the detailed steps outlined in this tutorial, you’ve gained the ability to:

  • Enhance Data Quality: Ensure records are created through proper forms with all necessary validations.
  • Enforce Workflows: Guide users to adhere to predefined processes for record creation.
  • Simplify UI: Reduce clutter and potential confusion for users who don’t need quick-add functionality.
  • Improve System Governance: Maintain better control over the data entering your Odoo system.

This customization demonstrates the flexibility and power of Odoo’s view inheritance system. It empowers developers and administrators to tailor the platform precisely to their organization’s unique operational needs, moving beyond out-of-the-box functionalities.

We hope this guide provides a clear and actionable solution to managing your Odoo 17 Kanban views. Have you implemented this or similar customizations? Share your experiences and tips in the comments below! Your insights are invaluable to the thriving Odoo community.


Discover more from teguhteja.id

Subscribe to get the latest posts sent to your email.

Leave a Reply

WP Twitter Auto Publish Powered By : XYZScripts.com