CRM Module Customization

Enhance Odoo's CRM with custom fields, workflows, and automation to better track leads, customer interactions, and sales pipelines.

Skills You'll Gain:
Odoo Module Development Workflow Automation Custom Model Design Security Rules UI/UX Customization
14 Tasks

Project Tasks

1. Set Up Module Structure

Before implementing any functionality, we need to create the basic structure of our customized module.

Implementation Steps:
  1. Create a new module named CRM Customization
  2. Set up the basic module structure with __init__.py, __manifest__.py
  3. Create models directory with models name.
  4. Create views directory with views name.

2. Define Manifest File

You need to provide basic description of the module, assert authorship, and choose a distribution license.

Implementation Steps:
  1. Define dictionary with the following info:
    • Module name is CRM Customization.
    • With meaningful summary.
    • Write your name as author name.
    • Define module version.
    • Choose the appropriate License
    • Declare that the module is featured as an app in the apps list.
    • Declare that the module is available for installation.

3. Add an icon

Adding icon to represent the app.

Implementation Steps:
  1. Add icon to your app.

4. Add "Customer Type" field.

Your customer needs to classify leads/opportunities by their business type for better segmentation and targeted sales approaches.

Implementation Steps:
  1. Extend the res.partner model as the following:
    1. Add Customer Type field: It is a selection field with (Wholesale, Retail, Corporate) options.
    2. Add tooltip text to explain the field.
    3. Set a default value = Retail.
    4. In the customer form add the Customer Type field under Customer Name field .
    5. Add a filter and group by Customer Type in list views

5. Customer Mandatory fields

Your customer needs to make Phone No mandatory for (Company) and Mobile No mandatory for (Individuals)

Path:

CRM → Sales → Customers


Implementation Steps:
  1. Extend the res.partner model as the following:
    1. Make Phone field mandatory when company_type = company
    2. Make Mobile field mandatory when company_type = individual

6. Add Lead Sequence field.

Add an auto-generated unique sequence number to each lead/opportunity.

Path:

CRM → Sales → My Pipeline


Implementation Steps:
  1. Extend crm.lead model to add the sequence field and do the following
    1. Field format LEAD-0001
    2. Not editable
    3. No duplicates, even when copying leads
    4. Display the sequence in CRM forms, lists, and kanban.
    5. Allow search by sequence in list views

7. Restrict user access

Your customer needs to ensure each user can only see their own CRM leads and contacts

Implementation Steps:
  1. Apply Record Rules to crm.lead (Leads/Opportunities) and res.partner (Contacts)

8. Auto-Lock Won Opportunities

Your customer needs to have an automatic locking mechanism for CRM opportunities when they are moved to the "Won" stage, preventing further modifications by standard users while allowing read-only access.

Path:

CRM → Sales → My Pipeline


Implementation Steps:
  1. Make all CRM opportunity fields become read-only when moved to the "Won" stage.

9. Set Opportunity Title to Selected Company Name

Your customer needs to automatically set the title of opportunities in the Odoo CRM module to the name of the selected company.

Path:

CRM → Sales → My Pipeline


Implementation Steps:
  1. In your extended crm.lead model do the following:
    1. Set the opportunity title to the name of the selected company

10. Validate Phone Number Format In Lead

Your customer needs to implement a validation mechanism in the CRM to restrict users from entering invalid phone numbers. The system should ensure that only valid phone number formats are accepted.

Path:

CRM → Sales → My Pipeline


Implementation Steps:
  1. In your extended crm.lead model do the following:
    1. Develop a method to validate the format of the phone number
    2. Ensure the method checks for the following allowed characters: Digits (0-9), Spaces, Plus signs (+)
    3. If validation fails, generate a user-friendly error message indicating that the phone number format is invalid.