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).

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

mrp.bom.operation_id

The first step is to edit the Property Mapping created in the previous article.

Property Mapping Setting
Old value
New value

Is Manufacturing Step

false

true

Update Odoo On Submit?

false

true

When writing a value to Odoo, you have to provide the full spec of the object in the form.

"value":  
{ 
  "sequence": 30,
  "name": "Punch",
  "workcenter_id": 3,
  "time_mode": "manual",
  "time_mode_batch": 10,
  "time_cycle_manual": 60
}

After adding the new Property Mapping, add an export rule in addition to the import rule from the previous topic Read BOM Operations

Setting
Value

Type

export

Name

Text Manipulation

Process for {Primary}

false

Process for Odoo

true

JavaScript expression

return s
  .map(
    (workCenterId) => JSON.parse(pm.objectListItems).find((item) => item.workCenterId === workCenterId)?.value || null
  )
  .filter((n) => n != null);

What this rule does

We specified a list of standard items in the Property Mapping settings.

This list is the list that we want to pick from, so that we can add this to the BOM operations

Last updated