Write BOM Operations

BOM operations are individual operations that are performed on the item. This page follows on the progress from the previous topic Read BOM Operations

The best way to manage operations is to be consistent in your naming convention for your operations.

In other words, if you are going to assemble something, always give it the exact same name (e.g. Assembly or Assemble).

Create a new Property Mapping

To write these operations to the Odoo BOM, we map to the Odoo property

mrp.bom.operation_ids

The first step is to create a Property Mapping in addition to the Property Mapping created in the previous article.

Create a new Property Mapping with the following settings :

Setting
Value

Property Name / Header

BOM Operations

Accessor

bomOperations

Primary Property

(Unmapped) (or a related property in the Primary Source)

Secondary Property

mrp.bom.operation_ids

List Name

mrp.workcenter

List Value Selector

{id}:{name}

Update Odoo on Submit

false

Rendering Type

Advanced List

List Display Selector

operationName

List Value Selector

workCenterId

List items

Here is a sample of what you can insert, but it can be anything, whatever you use most frequently [more on this below]**

Enabled

true

Prefer Odoo Value

true

Property Mapping Setting
Old value
New value

Update Odoo On Submit?

false

true

Add new Export Rules

After adding the new Property Mapping, add 2 new export rules

Setting
Value

Type

export

Name

Text Manipulation

Process for {Primary}

false

Process for Odoo

true

JavaScript expression

What this rule does

For the mapped BOM operations, get the id of the existing BOM operation line. Use this to determine if the BOM operation should be added or updated

Setting
Value

Type

export

Name

Export Manipulation

Process for {Primary}

false

Process for Odoo

true

JavaScript expression

What this rule does

If there is no value for the bomOperations value, then remove it, clearing the operations from Odoo

Last updated