SharpSync
  • Welcome
  • Fundamentals
    • Getting Started
      • Registration
      • Landing Page
      • Support
      • Subscription
    • Data Sources
    • Property Mappings
      • Adding Property Mapping
      • Property Mapping Settings
    • Rules
      • Import / Export
        • Append text
        • Calculate number
        • Export manipulation
        • Format as decimal number
        • Prepend text
        • Remove property
        • Replace all instances
        • Replace first instance
        • Round to nearest X
        • Select from JSON
        • Set cell value
        • Set empty cells
        • Text manipulation
      • Display
        • Number between
        • Text contains
        • Text ends with
        • Text evaluation
        • Text is a number
        • Text is exactly
        • Text is in list
        • Text is not a number
        • Text is not empty
        • Text is not in list
        • Text length between
        • Text length is exactly
        • Text maximum length
        • Text minimum length
        • Text not contains
        • Text not ends with
        • Text not starts with
        • Text starts with
      • Advanced Scripting
    • BOM Comparison
    • Data Safety
    • Troubleshooting
      • Duplicate component paths
      • OAuth 2.0
  • Data Sources
    • Autodesk Inventor
    • CSV
      • Getting Started
      • Importing a Bill of Materials (BOM)
    • MS Dynamics 365 Business Central
      • Getting Started
      • Item Fields Json & Internal Names
      • Resource Fields Json & Internal Names
      • List Names For nestedObject Mappings
    • NetSuite
      • OAuth Setup
        • Permissions
      • RESTlet Script Setup
        • SharpSync RESTlet Script
      • Thumbnail Folder Setup
      • Authentication + Configuration
      • Common setup
        • Configure quantity mapping
        • Configure accounts mappings
        • Configure itemType mapping
        • Configure isPhantom mapping
        • Configure subsidiary mapping
        • Configure price mapping
        • Configure Where Used Link mapping
        • Configure thumbnail mapping
        • Read-Only NetSuite Fields
        • Common Mapping Rules
        • Common List names
      • Advanced Bill of Materials
      • Configure Routings
      • Integration tips
      • Troubleshooting
    • Odoo
      • Getting Started
        • Authentication + Configuration
        • Debugging tips
      • Common Setup
        • Map BOM Codes
        • Map BOM Types
        • Map Attribute Values
          • Reading Attributes - Overview
          • Display All Attribute Names
          • Display Single Attribute Values
          • Writing attributes
      • Product Management
      • Hosting Options
      • List Names
      • Permissions
      • Troubleshooting
    • Onshape
      • Getting Started
      • Setting up Derivatives
    • Propel PLM
      • Getting Started
    • SolidWorks
    • SolidWorks PDM
      • Downloading and installing the add-in
      • Configure the add-in
      • Setting up the Solidworks PDM Web 2
      • Troubleshooting
      • Submitting a BOM for update
  • Advanced
    • Derivatives
  • User management
    • User Management
    • Application Permissions
Powered by GitBook
On this page
  • Common List names
  • The result returned from this may look something like this
  • List data (e.g. Stock Routes)
  • Setting up the list on screen
  1. Data Sources
  2. Odoo

List Names

Common List names

When setting up an Odoo source, it is useful to query the Odoo instance for lists of values for use in nestedObject property mappings. This provides a way for you to keep the values that users can select in sync with those in Odoo.

[!NOTE] For this to work the type in Odoo (as shown in SharpSync) must be nestedObject. We don't currently support list queries for other native SharpSync types like array

List name
Returns
Sample data

mrp.workcenter

List of work centers operations (will show duplicates

[ 1, "Assembly Line 1"], [ 2, "Drilling" ]

mrp.workcenter.tag

List of work center tags

[ 1, "Finishes" ]

product.category

Product template categories

[ 1, "All" ], [ 9, "All / Consumable" ]

product.attribute **

Returns registered attributes

[ "Color", "Duration", "Finish" ]

product.tag

Tags assigned on the General Information tab

[ 11, "Kit" ], [ 12, "Assemble" ], [ 81, "Switches" ]

res.company

List of all registered companies in your Odoo instance

[ 3, "SharpSync CA"], [1, "SharpSync USA"]

resource.resource

Lists all the registered Odoo resources

stock.location

Locations you can assign for warehouses

[ 14986, "MP" ], [ 14995, "MP/Assemble" ], [ 14990, "MP/Output" ],

stock.route

Routes available for selection [2]

[ 1, "Replenish on Order (ROO)" ], [ 2, "Receive in 1 step (RIS)" ]

You can view and configure all the attributes by navigating to Inventory > Configuration > Attributes

** The list product.attribute is special in that you can expand upon the query by adding attribute name at the end in square brackets. Example, by looking at the list values above, you can use the value

product.attribute["Finish"]

This will query all the values of the Finish attribute.

However this may return complex values which you could refine with a value selector such as

{id} : {name}

The result returned from this may look something like this

1 : |10 : Powder Blue|2 : |3 : |4 : |9 : Satin Black

List data (e.g. Stock Routes)

List data values (in this case Stock routes) are represented as integer values in Odoo. You can query list values with the following POSTMan request

{
  "id": 27,
  "jsonrpc": "2.0",
  "method": "call",
  "params": {
    "args": [ ],
    "model": "stock.route",
    "method": "name_search",
    "kwargs": {
      "context": {
        "lang": "en_US",
        "tz": false,
        "uid": 1,
        "allowed_company_ids": [ 1 ] // leave blank for all companies
      }
    }
  }
}

A typical list of values for this request returned from Odoo looks like this:

{
    "jsonrpc": "2.0",
    "id": 27,
    "result": [
        [
            1,
            "Route 1 - Supply Product from MP"
        ],
        [
            2,
            "Route 1 - Product from WS"
        ],
        [
            3,
            "Route 1 - Supply from VH"
        ],
        //...etc
}

A typical cell value returned from Odoo looks like this:

[1,5,7]

or

[7]

Not very user friendly, but we can fix that in the next step

Setting up the list on screen

Now that we know how to get the values, lets setup the list displayed onscreen. Lists like this can be cached in SharpSync, so the setup is done once and refreshed from time to time.

List name: stock.route List Value Selector: {id} : {display_name}

Once this is done, click the copy button

So we need to convert the ids into a proper string to display onscreen. For that we'll use a Text Manipulation Rule to do the trick.

Make sure that the following Text Manipulation rule is applied for stock routes

  • Rule Type: Text manipulation

  • Applies to: Odoo

  • Rule Value:

const jsonArr = JSON.parse(s); 
return jsonArr.map(ss => ss.toString());
PreviousHosting OptionsNextPermissions

Last updated 10 days ago