Map BOM Types

In Odoo the default values for BOM types can be in the range

  • Manufacture this Product

  • Kit

  • Subcontracting

[These can depend on your installation, but it is a common theme]

To update this from SharpSync, start by adding a Property Mapping for

mrp.bom.type

Setting
Value

Primary Accessor

(Unmapped)

Secondary Accessor

mrp.bom.type

Prefer Odoo Value

checked

Update Odoo on submit

checked

Rendering Type

Advanced List **see setup below

The type of the Odoo property will be array . This is an indication that you can typically select from a list of values in Odoo. In my example the value of this array looks like this

bundle (Bundle)|normal (Manufacture this product)|phantom (Kit)

This means there are 3 internal values in Odoo:

Value a user may select
User sees in Odoo

bundle

Bundle

normal

Manufacture this product

phantom

Kit

To view these values in Odoo, navigate to

Settings > Technical > Database > Fields Selection

Search for BOM Type

Let's setup an Advanced Selection list to present this to the user in SharpSync.

  • Copy the values in the Array Enum Values field

  • Using ChatGPT, Claude, Copilot or similar, convert it to a text json list using the prompt

Convert this to a json list with string kv pairs using the value before parenthesis as 'name' and the value in the parenthesis as 'value'

  • Copy the output

Back in SharpSync, make the following edits to the property mapping for Bom Type:

Setting
Value

Rendering Type

Advanced List

List Display Selector

value

List Value Selector

name

Prefer Odoo Value

checked

For the list items, paste the value in your clipboard specified in the previous step. It should look like the following:

[
  { "name": "bundle",  "value": "Bundle" },
  { "name": "normal",  "value": "Manufacture this product" },
  { "name": "phantom", "value": "Kit" }
]

I'm now able to display + update the values from Odoo

Last updated