Managing contacts that act as customers, vendors, or both is a common challenge in Odoo, especially in multi-module and multi-client environments. In standard Odoo, Sales and Purchase fields are always visible on the contact form, and contacts can appear in both Sales Orders and Purchase Orders regardless of their actual business role. This leads to confusion, incorrect document creation, and inconsistent data usage.
The Contact Type Classification with Dynamic Tab & Field Visibility SME solves this problem by introducing a dedicated Contact Type field on the partner form. This field allows users to explicitly classify a contact as:
- Customer
- Vendor
- Customer & Vendor
Once a Contact Type is selected, the system dynamically adjusts the user interface:
- If the contact is marked as Customer, only Sales-related tabs and fields are visible.
- If marked as Vendor, only Purchase-related tabs and fields are visible.
- If marked as Customer & Vendor, both Sales and Purchase tabs are available.
For company contacts, this classification becomes the source of truth. All child contacts automatically inherit the Contact Type from their parent company and cannot change it individually. This ensures consistency across all related contacts and prevents accidental misclassification at the child level.
The SME also enforces this classification in transactional workflows:
- Sales Orders will only allow selection of contacts classified as Customers (or Customer & Vendor).
- Purchase Orders will only allow selection of contacts classified as Vendors (or Customer & Vendor).
This approach replaces fragmented, client-specific logic with a clean, configurable, and reusable solution that can be applied consistently across all STAR clients.
Key Benefits
- Clear Contact Classification: Explicitly defines whether a contact is a Customer, Vendor, or both.
- Dynamic UI Control: Automatically shows or hides Sales and Purchase tabs based on contact type.
- Data Accuracy: Prevents using vendors on sales documents and customers on purchase documents.
- Inherited Consistency: Child contacts inherit the company’s classification, eliminating mismatches.
- Reusable SME Design: Provides a standardized solution instead of client-specific custom logic.
- Improved Usability: Reduces clutter on the contact form by displaying only relevant fields.
Example Use Case
A company creates a new partner record for a supplier. The Contact Type is set to Vendor. As a result:
- The Sales tab is hidden on the contact form.
- The contact is available for selection in Purchase Orders.
- The same contact does not appear in Sales Order customer selection.
Later, the supplier also becomes a customer. The Contact Type is updated to Customer & Vendor, immediately enabling both Sales and Purchase tabs and allowing use in both document flows—without duplicating contacts or changing child records individually.
Conclusion
The Contact Type Classification with Dynamic Tab & Field Visibility SME delivers a clean, scalable, and intuitive way to manage partner roles in Odoo. By combining explicit classification, dynamic interface control, inherited behavior for child contacts, and document-level restrictions, this feature significantly improves data integrity, user experience, and operational accuracy across Sales and Purchase workflows.
Contact Type Classification with Dynamic Tab & Field Visibility