Skip to Content
Menu

Odoo-SalesForce Connector

by
Odoo

346.91

v 18.0 Third Party
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies CRM (crm)
Sales (sale_management)
Calendar (calendar)
Contacts (contacts)
Discuss (mail)
Invoicing (account)
Lines of code 9451
Technical Name oe_salesforce_connector
LicenseAGPL-3
Websitehttps://odooerp.ae
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies CRM (crm)
Sales (sale_management)
Calendar (calendar)
Contacts (contacts)
Discuss (mail)
Invoicing (account)
Lines of code 9451
Technical Name oe_salesforce_connector
LicenseAGPL-3
Websitehttps://odooerp.ae
Versions 16.0 17.0 18.0
Odoo-Salesforce Integration Odoo-Salesforce Integration
Large Image

API Configuration

Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1

Import-Export Account

Screenshot 1
Screenshot 1

Import-Export Contact

Screenshot 1
Screenshot 1
Screenshot 1

Import-Export Event

Screenshot 1
Screenshot 1
Screenshot 1

Import-Export Opportunity

Screenshot 1
Screenshot 1
Screenshot 1

Import-Export Product

Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1

Import-Export Quotation

Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1
Screenshot 1

Module User Guide

This Odoo module provides an integration with Salesforce, enabling synchronization of key business data between your Odoo instance and Salesforce CRM. It streamlines data flow and ensures consistency across both platforms. 🔄


1. Module Overview

This module facilitates the synchronization of various business records, including customer information, products, sales orders, quotes, opportunities, leads, contracts, and activities, between Odoo and Salesforce. It streamlines data flow and ensures consistency across both platforms. 🔄


2. Configuration (Salesforce Instance Setup)

To set up the integration, you need to configure a Salesforce instance within Odoo:

  1. Access Configuration: Navigate to the Salesforce Integration settings in Odoo.
  2. Instance Details: Provide the following Salesforce API credentials:
    • Name: A descriptive name for your Salesforce instance (e.g., "Production Org").
    • Consumer Key: From your Salesforce Connected App.
    • Consumer Secret: From your Salesforce Connected App.
    • Authorization URL: Default: https://login.salesforce.com/services/oauth2/authorize
    • Token URL: Default: https://login.salesforce.com/services/oauth2/token
    • Redirect URL: Default: http://localhost:8069/get_auth_code_from_sf
    • Instance URL: e.g., https://yourinstance.salesforce.com
  3. Authentication: Use the "Salesforce Login" button to authenticate Odoo with Salesforce.
  4. Connection Test: Click "Salesforce Test" to verify credentials.
  5. Synchronization Limits: Set Import/Export limits to manage performance.
  6. Default Instance: Mark one instance as default for Cron jobs. 🤖

3. Key Synchronized Data & Features

This module adds Salesforce-specific fields (e.g., x_salesforce_id, x_is_updated) to various models for tracking sync status.

Supported record types:

  • Accounts/Contacts (res.partner) 🤝
  • Products (product.template, product.product) 📦
  • Sales Orders (sale.order) 📝
  • Quotations (inherited from sale.order) 📧
  • Opportunities & Leads (crm.lead) 💰📞
  • Contracts (sf.contract) 📄
  • Mail Activities (mail.activity) ✅
  • Calendar Events (calendar.event) 🗓️
  • Attachments (ir.attachment) 📎
Note: Only updated records are processed based on their last modified time.

4. Synchronization Process

  • Manual: Export records from form/list view with "Export to Salesforce" or "Sync Now" buttons. 🚀
  • Cron Jobs: Auto-import/export via scheduled jobs (e.g., _scheduler_export_leads_to_sf). ⏰

5. Basic Troubleshooting

  • Authentication Issues: Use "Salesforce Test" to diagnose problems. Ensure all credentials match your Salesforce Connected App. 🚫🔑
  • Validation Errors: Only one instance per company should be default. Ensure all required fields are properly filled. Check Odoo logs for details. 🐛

Frequently Asked Questions

What is the purpose of this module?
This module facilitates bi-directional data synchronization and management between Odoo and Salesforce, allowing you to seamlessly manage various business records across both platforms.
What Salesforce API version does this integration use?
The module primarily uses Salesforce API versions v52.0 (for Quote and Order related operations) and v39.0/v40.0 for other objects like Products and Events.
How do I configure the Salesforce instance in Odoo?
You need to set up a Salesforce instance record in Odoo. This involves providing the following Salesforce API credentials:
  • Consumer Key (Client ID): Obtained from your Salesforce connected app.
  • Consumer Secret (Client Secret): Obtained from your Salesforce connected app.
  • Authorization URL: Default is https://login.salesforce.com/services/oauth2/authorize.
  • Authorization Token URL: Default is https://login.salesforce.com/services/oauth2/token.
  • Redirect URL: Default is http://localhost:8069/get_salesforce_token (ensure this matches your Salesforce connected app's callback URL and is accessible).

You will also need to authorize the connection to obtain the access token.

What happens if there is no default Salesforce instance configured?
Many synchronization and export operations will fail with an error message like "There is no default Salesforce instance" if a default instance is not configured in Odoo.
Which Odoo records can be synchronized with Salesforce?
The module supports synchronization for the following Odoo objects with their corresponding Salesforce counterparts:
  • Accounts (res.partner where is_company=True)
  • Contacts (res.partner where is_company=False)
  • Products (product.product)
  • Product Templates (product.template)
  • Sale Quotations (sale.order in draft/sent state)
  • Sale Orders (sale.order)
  • Leads (crm.lead of type 'lead')
  • Opportunities (crm.lead of type 'opportunity')
  • Contracts (sf.contract)
  • Events (calendar.event)
  • Activities (Tasks) (mail.activity)
  • Attachments (ir.attachment)

Is the synchronization bi-directional (Odoo to Salesforce and Salesforce to Odoo)?

Based on the code, the module supports:

  • Export from Odoo to Salesforce: For Accounts, Contacts, Products, Product Templates, Sale Quotations, Sale Orders, Leads, Opportunities, Contracts, Events, and Activities.
  • Import from Salesforce to Odoo: For Accounts, Contacts, Products, Product Templates, Quotes, Orders, Leads, Opportunities, Contracts, Events, and Activities (via scheduled cron jobs).
How is data synchronization initiated?
Synchronization can be initiated in two ways:
  • Manual Export: Users can manually trigger the export of individual records (e.g., Partners, Products, Leads, Opportunities, Quotes, Orders, Contracts, Events, Activities) from their respective Odoo forms.
  • Scheduled Cron Jobs: The module includes scheduled actions (cron jobs) to automatically import and export data for various objects at predefined intervals (e.g., _scheduler_import_sf_accounts, _scheduler_export_products_to_sf).

How does the module handle updates to records in Odoo?

Records in Odoo have an x_is_updated field. When certain fields are modified (e.g., x_last_modified_on for partners), this flag is set to True, indicating the record needs to be updated in Salesforce during the next export sync.

How are deleted records handled?

The unlink method for sale.order (Quotes/Sale Orders) and sale.order.line is extended to attempt deletion of corresponding records in Salesforce if they were previously exported (i.e., have a Salesforce ID). This helps maintain data consistency.

How are Products and Product Templates synchronized?

Product Templates and their variants can be exported to Salesforce as Product2 records. The integration also handles the creation and updating of PricebookEntry records in Salesforce for these products, linking them to a standard price book.

What happens when a Sale Order's contract changes?

If the contract_id on a Sale Order is changed, the module validates that the Odoo order date is not earlier than the contract's start date, raising a UserError if it is.

How are attachments synchronized?

The module includes logic to export attachments from Odoo to Salesforce. It uses ir.attachment records and tracks the Salesforce ContentDocumentId to prevent duplicate uploads.

How are addresses synchronized for Partners/Contacts?

When partners (companies or contacts) are exported, their main addresses are synchronized. Additionally, separate delivery addresses linked to contacts (child res.partner records with type='delivery') are also created or updated in Salesforce.

Can I export Leads and Opportunities to Salesforce?

Yes, crm.lead records in Odoo can be exported to Salesforce as either Leads or Opportunities, depending on their type in Odoo.

What should I do if a record fails to export to Salesforce?

The module logs errors to Odoo's log file (e.g., _logger.error). Check the Odoo server logs for detailed error messages, as these often include the Salesforce response which can pinpoint the exact issue (e.g., FIELD_INTEGRITY_EXCEPTION, missing required fields, permissions issues).

Error logs will contain specific Salesforce API responses that help identify the root cause of synchronization failures.

I'm getting "There is no Salesforce instance" error. What's wrong?

This error indicates that no Salesforce instance has been configured or that the configured instance is not set as the default one for your company. Go to the Salesforce configuration in Odoo and ensure an instance is properly set up and authorized.

Always verify that your Salesforce instance is configured and set as the default before attempting any synchronization.

Why might a ContentDocumentLink fail when exporting attachments?

Even if the attachment (ContentVersion) is created, linking it to a record can fail due to:

  • Insufficient permissions for the Salesforce integration user on the target record (e.g., Quote, Sale Order).
  • The target record itself is in a state that prevents linking (e.g., archived, read-only).
  • Incorrect ShareType or Visibility settings in the ContentDocumentLink payload (less common for a "bad ID" error, but worth checking).

Always check Salesforce debug logs for the precise error.

I encountered "Please Select 1 record to Export" error.

This UserError is raised by the module when you try to manually export multiple records at once for certain objects (e.g., Products, Events) which are designed for single-record manual export. Select only one record at a time for manual export. Scheduled cron jobs will process multiple records automatically.

Scheduled cron jobs can handle bulk exports, while manual exports are limited to single records for certain object types.

Why are some fields not synchronizing correctly?

Possible reasons include:

    The field mapping in the integration code might be incorrect or missing.
  • Salesforce field-level security or validation rules might be preventing the update.
  • Data type mismatch between Odoo and Salesforce fields.
  • The Odoo record's x_is_updated flag is not correctly set.

Review the specific sendDataToSf or create/update_sf_dict methods in the relevant Python file and check Salesforce validation rules/permissions.

Module Support & SLA
For any support related to this Odoo module, please contact us at apps@odooerp.ae
Our standard response time (SLA) for support queries is between 12 to 48 hours.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.