Package: odoo8-addon-connector-salesforce
Salesforce ConnectorThis module allows to import and export various models between
Odoo and Salesforce.It provides the foundations to create or extend various synchronizations.By default following synchronizations are supported out-of-the box:Import of Account and contact into Odoo Partners. Salesforce is the master.
Parent relation of Sales force account is not supported at this time.Import or export of Product. ERP or Salesforce can be master. Bidirectional synchronization is not supported and a master must be set.Import of Salesforce priceBook entries into Odoo pricelist version. Salesforce is the master.Import of won opportunities into Odoo. Salesforce is the master.InstallationTo install this module, you need to:install simplesalesforcepip install simple-salesforceinstall requestspip install requestsConfigurationConfigure Connection With SalesforceThere are 2 supported ways to access a Salesforce instance with the Salesforce connectorOauth2 flowIn SalesforceIn order to use it you have to add a remote application in Salesforce administration
and enable Oauth2 login. The app should preferably be namedodoo_connectorThe created remote access app must have following parameters:Permitted Users –> All users may self-authorize
Callback URL –> public_odoo_url/salesforce/oauthOnce done, you have to manage your app and ensure theRefresh token is valid until revokedparameter is set
and configure the desired authorization of the app.In OdooGo to the menuConnector -> Salesforce -> Salesforce backendand create a new backend.
Go to theAuthenticationpage of your backend and input the following parameters:Authentication Method: Choose oauth2URL: Input the URL of your Salesforce instanceConnect on sandbox instance: Check it if you are working on a sandox Salesforce instanceOAuth2 Consumer Key: Input the consumer key provided by Salesforce appOAuth2 secret: Input the consumer secret provided by Salesforce appPublic secure URL of Odoo (HTTPS): Input the callback URL you have specified in SalesforceOAuth2 client authorization code: Input the authorization code provided by Salesforce appChoose a default shop inImport/Export Configurationpage and save your backend.Then simply press theAuthorize Odoo in Salesforcebutton and follow the instruction provided
in Salesforce. Once done, your application must be authorized in Salesforce and tokens
must be present in backend.Security warning: Only the OAuth flow is production proof. Other Authentication methods are still exprimental!User Authentication processThis flow allows a user to connect to api using SOAP access
in order to get a token. The first step is to pass the domain of your Salesforce instance
and an access token straight in Odoo backend.You must have the full URL of your instance (e.g.https://na1.salesforce.com)You need to select one of the two supported  means of authentication:Using username, password and security tokenUsing IP filtering, username, password and organizationIdSecurity Warning: This approach is simpler but less secure than Oauth authentication process.Configure Import Export with SalesforceOnce you backend is set up you can configure your synchronization flow in theImport/Export Configurationpage.Products SynchronizationThe first step is to choose the direction of the product synchronization. Once
set, you should not change it anymore.**  There is the possibility to do an initial import of the product and then change the direction **Product Type MappingSalesforce product type of Salesforce can not be imported and mapped in Odoo.
For this reason, you have to manually set the mapping in theProduct Configurationsection.
Simply select the Odoo type and link it with the corresponding Salesforce type.Simply choose the Odoo type and input the corresponding name of the Salesforce type.Price Book mappingSalesforce currencies can not be imported and mapped in Odoo.
You have to manually set the mapping under theProduct Book Entry Configurationsection.Simply select an Odoo pricelist version with desired currency and link it with
a Currency ISO code available in Salesforce.Once done, it should look like this:UsageThere are two ways to use the module: go to the backend and click on the Action
buttons available under theActionspage or activate one of the cron jobs,
depending on the desired synchronization in theSettings/technical/automation/scheduledactions.SF - Odoo: Synchronization summarySalesForceDirectionOdooAccount→Partner
with the checkbox IsCompany
checkedContact→Partner
with the checkbox IsCompany
unchecked linked to
the parent partnerState + Country + title→State + Country + titleProduct← or →Product
Import of product was designed
for initial import and should
not be used later even if it
can workPricebook entry→Pricelist itemWon Opportunity→Sale OrderTest UseCaseIn SalesforceCreation of an AccountScroll down to see the section ‘Contact’ and click on ‘New contact’
- create contact ‘Mrs Marie Durand’
- create contact ‘Helmut’Creation of an opportunityCreation of the ‘opportunity A’
- Scroll down to see the section ‘Quote’ and click on ‘New quote’Creation of the Quote A1
- with contact ‘Helmut’ (which does not belong to the Company A)saveScroll down to see the section ‘Quote Line items’ and click on ‘Add Line item’ in order to add products in the quote.Tick the product and click on Select buttonChange the price to 99, set the Qty = 5 and add a discount of 15%SaveSet the Quote/Opportunity as WonGo back to the Quote, click on ‘Start Synch’ (and confirm)Reopen the opportunity, click on Edit and change the stage to ‘Won’SaveIn OdooNow the Opportunity can be synchronized with Odoo.Import won opportunity from Odoo. Importing Opportunity in Odoo will
automatically trigger all other synchronizations. For instance, if you try to
import an opportunity but the partner (= SF account) does not exist yet in
Odoo, the connector will automatically launch a direct import of this
specific account, without job creation. Same goes for the other missing items
such as product, price, etc.Known issues / RoadmapCleanup and DRY refactoring for common code to be doneExtend the test coverage to product and corner casesImprove SO onchange managementFix simple Salesforce exception lookup on next release of libraryImport Sales Quotation must copy, store and set as inactive the created addressSupport the usecase of deactivating a deleted bindingBattle test authentication process and fix itCreditsImagesOdoo Community Association:Icon.ContributorsNicolas BessiAlexandre Fayolle <alexandre.fayolle@camptocamp.com>MaintainerThis module is maintained by the OCA.OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.To contribute to this module, please visithttps://odoo-community.org.