Odoo, contact resolution
Looks up the caller in your Odoo by their number and exposes six variables. This module never blocks the call, even if Odoo is unreachable.
In brief
| Outputs | Found, Not found and Error |
| Fields | Odoo instance, Number to look up, and the Rename the caller with the found contact's name checkbox |
| Variables exposed | 6, always defined, including when the lookup fails |
| Number looked up by default | {{caller}} |
| Renaming | checked by default |
| Blocking the call | never, whatever happens |
| Wait time | not adjustable here; capped at 8 seconds |
The label of the block placed on the plan is Odoo Contact. The help text shown in the window is: "Looks up the Odoo contact matching the calling number (res.partner) and exposes {{odoo_found}}, {{odoo_partner_name}}, {{odoo_partner_id}}, {{odoo_user_id}}, {{odoo_user_name}}, {{odoo_user_extension}} (the salesperson's extension, empty if they don't have one). Outputs: Found / Not found / Error. If Odoo is unreachable, the call continues (fail-open)."
How it works
The lookup
The module searches Odoo's contacts for the one whose phone number matches the caller. It tries several forms of the same number, because a caller can arrive as +32…, 0032… or 0… depending on the carrier, and it backs this up with a comparison on the last nine significant digits. The first matching contact is kept.
It then reads their name and their salesperson, then goes to fetch that salesperson's extension from their Odoo record. A salesperson with no extension set leaves this last value empty.
The six variables
| Variable | What it contains |
|---|---|
odoo_found | 1 if a contact was found, 0 otherwise |
odoo_partner_name | the contact's name |
odoo_partner_id | their Odoo ID |
odoo_user_id | their salesperson's ID |
odoo_user_name | their salesperson's name |
odoo_user_extension | that salesperson's extension, empty if they don't have one |
They are always defined, even after a failure: in that case odoo_found equals 0 and the others are empty. You can therefore test them downstream without worrying about a missing value.
{{odoo_user_extension}} connects directly to a Call module: the caller reaches the salesperson handling their account, without you having to maintain a mapping by hand.
Renaming
The Rename the caller with the found contact's name checkbox replaces the caller's displayed name with the contact's. Your colleague reads the customer's name on their phone screen, even before answering. It is checked by default.
This module never blocks the call
This is the most important point, and the least known. This module enriches the call, it does not decide its fate. Whatever happens, Odoo down, expired credentials, a suspended instance, the call continues.
To do this, the module takes the first connected output, in a preference order: first the correct branch, then the others as a fallback. Three consequences, all useful:
- Connecting only the Found output is enough to make the plan work. All calls will go through there, found or not.
- An output you have not connected never cuts the call off, unlike the general rule for other modules.
- The Error output may therefore never be taken, if you have not connected it.
What to fill in
| Field | What is expected | If you leave it empty |
|---|---|---|
| Odoo instance | the Odoo to query, among those declared in Integrations, Odoo | Default instance, meaning the resolution instance declared for your installation |
| Number to look up | the number, generally {{caller}}; another variable is accepted | {{caller}} |
| Rename the caller with the found contact's name | checked, the contact's name shows on the phone called | unchecked, the name passed by the carrier is kept |
Steps
- First check that your Odoo is connected, in Integrations, Odoo, and that the instance is active there.
- Place the Odoo, contact resolution module and connect the previous node to its input.
- Open it and choose the Odoo instance, or leave the default instance if you only have one.
- Leave
{{caller}}in Number to look up, unless you want to look up a number obtained another way, for example from a DTMF entry. - Decide on renaming. Leave the box checked if your teams answer on phones that display the name.
- Click Save.
- Connect at minimum the Found output. Connect Not found and Error too the day you want to handle them differently.
- Place a Debugging module right after, with the message
found={{odoo_found}} name={{odoo_partner_name}} extension={{odoo_user_extension}}. - Click Save, then Apply changes in the top banner.
- Call from a number that exists in Odoo, then open the plan's Debug log and check the name found.
If it doesn't work
All calls come back Not found. The caller's number does not match any contact. Open the contact's record in Odoo and check that their phone number is filled in, then compare its format to the value of {{caller}} read in the Debug log. A contact with no number will never be found, no matter how good their record otherwise is.
The name doesn't show on my colleague's phone. Check the Rename the caller with the found contact's name box in the module. Then check that the found contact does have a name, and that the phone called displays the name and not just the number.
Calls keep being routed even though Odoo is down. This is the expected behavior. This module is never blocking: it takes the first connected output and the call moves on. Your six variables are then empty, and {{odoo_found}} equals 0.
The Error output is never taken. For the same reason. If Error is not connected, the module falls back to another connected output rather than cutting the call off. Connect Error if you want to see it used.
{{odoo_user_extension}} is always empty. Two cases. The contact has no salesperson assigned in Odoo, in which case {{odoo_user_name}} is also empty. Or the salesperson has no extension set on their Odoo record, and it needs to be filled in there.
How the call flow is built, explained in pictures
See the Dial plans page