Skip to main content

Lead Intake

A lead (crm.lead) represents a single customer interest in buying a vehicle. The BPO CRM receives leads through two channels:

  1. Automatic — a scheduled job pulls new records from each brand's distributor every few minutes.
  2. Manual — an agent creates a lead directly from the Open Leads kanban.

Both channels produce the same crm.lead record. Downstream processing (claim, work, close) is identical.

Automatic intake from distributors

What gets pulled

For every active brand with a working Distributor Connection (see Brands), the sync reads two remote models:

Remote model (Odoo 12)Lead source assignedPurpose
cheryweb.quotationsource_web_quotationWebsite quotation / inquiry form
cherywebsite.test.drivesource_web_test_driveWebsite test-drive booking form

Only remote records with status in ('pending', 'sent') are fetched, up to 100 per run, per model, per brand. After a successful import, the remote record is written back with status = 'synced' so it is not pulled again.

Schedule

The sync is a scheduled action (ir.cron) named CRM: Sync Distributor Campaign Leads and runs every 5 minutes by default.

To change the cadence, open Settings → Technical → Scheduled Actions and edit the entry. Interval is stored on the cron record (interval_number / interval_type), not per-brand.

:::info Why the sync button is unnecessary for normal operation The cron is the normal import path. The Sync Dealers and Sync Vehicle Models buttons on the Brand form are manual, configuration-time tools — you use them once during setup and when the distributor's catalog changes. You do not need to press a "sync leads" button; the cron handles that. :::

What each imported lead has pre-filled

From the distributor record:

Lead fieldFrom remote
contact_namefirst_name + last_name
emailemail
mobilemobile (falls back to 'N/A' if empty)
brand_idThe brand whose cron run pulled the record
dealership_idResolved from dealer_id on the remote (auto-created if missing)
vehicle_model_idResolved from model_id on the remote (auto-created if missing)
source_idWeb Quotation or Web Test Drive depending on remote model
preferred_dateOnly for test-drive leads
user_idEmpty — lead arrives unclaimed
stage_idFirst stage (New)

Inbound leads always arrive with user_id = False. That's what puts them on the unclaimed-pool kanban — see Claiming a Lead.

Customer-level deduplication

Even though every distributor record is unique, the same customer often submits multiple forms (e.g. a quotation and a test-drive, or two quotations on different days). To avoid fragmenting the pipeline:

After fetching a remote record, the sync looks for an open local lead matching:

  • contact_name ilike from the remote full name
  • email = remote email
  • mobile = remote mobile

Brand is not part of the match — a customer shopping across brands still consolidates onto one lead.

When a match is found:

  1. The existing lead gets a chatter note recording the duplicate source + remote id.
  2. The remote record is marked synced upstream.
  3. No new lead is created.

Matching requires both email and mobile on the remote record. Leads missing either field always create a new record.

"Open" means is_won = False AND is_lost = False AND active = True. A closed lead does not block a new one — a returning customer gets a fresh pipeline entry.

Manual intake

Agents can create leads directly for walk-ins, inbound calls, or any channel not wired into a distributor.

  1. BPO CRM → Pipeline → Open Leads
  2. Click New

New lead form

Required fields:

FieldNotes
Customer NameDisplay name of the lead contact
MobilePhone number — also used for customer dedup
Interested BrandMust exist as a crm.brand

Everything else (email, vehicle model, preferred color, budget, address) is optional but should be captured whenever possible.

:::tip Manual leads and dedup Customer-level dedup is only applied to distributor-synced leads. A manual lead is always created as-is, even if an open lead already exists for the same customer. If the agent needs to consolidate, they should move the note to the existing lead and archive the duplicate. :::

The Open Leads kanban — default landing view

BPO CRM → Pipeline → Open Leads is the default workspace for the BPO floor. It shows only leads where:

  • user_id = False (unclaimed)
  • is_won = False
  • is_lost = False

The view is a kanban grouped by Brand, so the floor can see at a glance how many pending leads each brand has and triage accordingly.

Open leads kanban

UI elementMeaning
ColumnOne per brand. Count in the header = leads waiting.
CardOne per unclaimed lead. Shows customer name, vehicle, and source badge.
Avatar (bottom-right)Empty — no agent assigned yet.
"Claim Lead" buttonPrimary action on every open card and on the form header.

Any BPO user (Agent, Supervisor, Manager) sees the same unclaimed pool here. The instant someone claims a lead, it disappears from everyone else's Open Leads view.

Troubleshooting

SymptomLikely cause
New website quotations never appearBrand's distributor connection is broken — open the brand, click Test Connection.
Cron runs but some remote models are skippedService account lacks access on cheryweb.quotation or cherywebsite.test.drive. Check server log for Remote model … not found or inaccessible.
A known customer's new quote isn't showing upIt was deduped into an existing open lead — check the chatter on that lead for the "Duplicate inbound lead" note.
Lead created with contact_name = 'Unknown'Remote record had no first_name / last_name. Clean up on the distributor side.
Lead created with mobile = 'N/A'Remote record had no mobile. These bypass customer dedup and always create a new lead.