| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 63 |
| Technical Name |
product_category_company_restrict |
| License | LGPL-3 |
| Website | https://odoo.co.ke |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 63 |
| Technical Name |
product_category_company_restrict |
| License | LGPL-3 |
| Website | https://odoo.co.ke |
Inventory • Multi-Company
Product Category Company Restrict
Restrict product categories by company — just like products. Assign categories to specific companies or share them globally, with automatic filtering in product forms and a built-in record rule to enforce visibility at the data layer.
Compatible With
📸 Module Screenshots
Visual walkthrough of the Product Category Company Restrict module
1 Company Field on Product Category Form
What you see: A new Company field added directly below the Parent Category field in the Product Category form view.
How to reach it: Go to
Inventory → Configuration → Product Categories and open or create any
category.
2 Company-Filtered Category Dropdown on Products
What you see: When creating or editing a product, the Company field is available to restrict visibility of the product based on the company selected , if left empty the product will be visible in all companies.
How to reach it: Go to
Inventory → Products → Products → New and click the Category
field.
3 Multi-Company Category Visibility — Before & After Switching
What you see: The category list view filters automatically when you switch companies. Categories restricted to Company A disappear when you switch to Company B, then reappear when you switch back.
How to reach it: Go to
Inventory → Configuration → Product Categories, then use the top-right
company switcher to change your active company.
Company Field on Categories
- New
Company field added to
product.category - Appears on the form view just below Parent Category
- Also visible in the list view as an optional column
Global (Shared) Categories
- Leave Company empty to share a category across all companies
- All existing categories remain unaffected — they stay global
- Global categories are always visible in dropdowns and lists
Auto-Filtered Product Category Dropdown
- Product form Category field only shows categories for the current company
- Prevents assigning categories from a different company to a product
- Improves UX by reducing dropdown noise in multi-company environments
Record-Level Security Rule
- Enforced via
ir.rule— works even for API/RPC access - Applies to all internal users
- Covers Read, Write, Create, and Delete permissions
Parent-Child Company Constraint
- Child category company must match its parent (or parent must be global)
- Mismatch raises a clear validation error
- Prevents broken category hierarchies across companies
Lightweight & Non-Intrusive
- Only depends on the
productmodule - No database migration for existing categories — they default to global
- Works on both Community and Enterprise editions
ir.rule record rule at the ORM
level, not just in the UI. This means it is enforced for all access methods —
including direct API calls, RPC, and URL manipulation.
Latest Release 19.0.1.0.0
2026-03-03- Initial Odoo 19 release.
- Added
company_idfield toproduct.category. - Auto-filtered category dropdown on product form by current company.
- Record rule enforcing multi-company category visibility at ORM level.
- Parent-child company consistency validation constraint.
- Company column added to category list view (optional show).
📅 Changelog
| Date | Version | Notes |
|---|---|---|
| 2026-03-03 | 18.0.1.0.0 | Initial release — company restriction for product categories |
📜 Licensing
License Type
LGPL-3Redistribution
No redistributionFull Policy
View PolicySupport & Contact
support@odoo.co.ke
https://odoo.co.ke/helpdesk
+254739444447
1 business day SLA
# Product Category Company Restrict
Version: 18.0.1.0.0 Author: Metro ICT Limited Website: [https://odoo.co.ke](https://odoo.co.ke) Support: [support@odoo.co.ke](mailto:support@odoo.co.ke) License: LGPL-3 Category: Inventory Depends: product
---
## Overview
Product Category Company Restrict adds company-level visibility control to Odoo product categories, mirroring the same restriction logic already available on products themselves.
A Company field is added to each product category. When a company is set, the category is only visible and usable within that company. When left empty, the category is shared globally across all companies — fully backwards-compatible with your existing data.
---
## Key Features
|---|---| | Company field on categories | Added to the form view (below Parent Category) and as an optional list column | | Global (shared) categories | Leave Company empty to share across all companies | | Auto-filtered product dropdown | The Category field on products only shows categories for the current company or global ones | | Record-level security rule | Enforced via ir.rule — works for UI, API, and RPC access | | Parent-child constraint | Child category must match parent's company, or parent must be global | | Zero migration | Existing categories default to global — no data changes needed |
---
## Screenshots
|---|---|---| | 1 | Company field on the Product Category form | static/description/assets/screenshots/company_field.png | | 2 | Company restriction field visible on the Product form | static/description/assets/screenshots/company_restrict.png |
---
## How It Works
### 1. Assigning a Category to a Company Go to Inventory → Configuration → Product Categories, open any category, and set the Company field. That category will now only be visible to users operating under that company.
Leave the Company field empty to keep the category available across all companies (shared/global).
### 2. Auto-Filtered Dropdown on Products When creating or editing a product, the Category dropdown automatically filters to show only: - Categories with no company (global/shared), and - Categories belonging to the current active company
This prevents users from accidentally assigning categories from another company to a product.
### 3. Record Rule Enforcement A record rule (ir.rule) is applied to product.category for all internal users:
` domain: ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] `
This rule enforces visibility at the ORM level — it applies to: - The UI (list and form views) - External API calls (JSON-RPC, XML-RPC) - Any direct ORM access
### 4. Parent-Child Company Consistency A @api.constrains method prevents invalid parent-child combinations:
|---|---|---| | (empty / global) | Company A | ✅ Yes | | Company A | Company A | ✅ Yes | | Company A | (empty / global) | ✅ Yes | | Company A | Company B | ❌ Validation Error | | Company B | Company A | ❌ Validation Error |
---
## Installation
- Copy the product_category_company_restrict folder into your custom addons directory.
- Restart the Odoo server.
- Enable Developer Mode (Settings → General Settings → Developer Tools).
- Go to Apps → Update Apps List.
- Search for "Product Category Company Restrict" and click Install.
---
## Configuration
No extra configuration is required after installation. Simply:
- Go to Inventory → Configuration → Product Categories.
- Open any category and set the Company field to restrict it, or leave it empty to keep it global.
---
## Compatibility
|---|---| | Community | ✅ | | Enterprise | ✅ | | Odoo.sh | ✅ | | Odoo Online (SaaS) | ❌ (custom Python modules not allowed) |
---
## Module Structure
``` product_category_company_restrict/ ├── __init__.py ├── __manifest__.py ├── README.md ├── models/ │ ├── __init__.py │ └── product_category.py # company_id field + constraint + product domain ├── security/ │ ├── ir.model.access.csv # CRUD access for internal users │ └── product_category_rules.xml # Multi-company ir.rule ├── views/ │ └── product_category_views.xml # Form + list view inheritance └── static/
- └── description/
├── index.html ├── banner.png ├── hero.webp └── assets/
- └── screenshots/
- ├── company_field.png └── company_restrict.png
---
## Changelog
|---|---|---| | 2026-03-03 | 18.0.1.0.0 | Initial release — company restriction for product categories |
---
## Support
- Email: [support@odoo.co.ke](mailto:support@odoo.co.ke)
- Helpdesk: [https://odoo.co.ke/helpdesk/customer-support-1](https://odoo.co.ke/helpdesk/customer-support-1)
- Phone: +254739444447
- Response Time: 1 business day SLA
- 90-day complimentary support included with your purchase
---
Developed and supported by **Metro ICT Ltd.**
Please log in to comment on this module