Read BOM Operations

BOM operations are individual operations that are performed on the item. There are 2 scenarios, reading and writing. BOM operations are never repeated. Even if you see duplicates in Odoo, they each have their own underlying unique operationId for that line in the BOM.

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

BOM operations can often include one or more of the following items in the table

Destructive operation
Non-Destructive operation

Punching

Painting

Welding

Assembling

Galvanizing

Powder Coating

etc.

Wiring

To read these operations from the BOM, we map to the Odoo property

mrp.bom.operation_id

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
} 
           

This is shown the example below

Create a new Property Mapping with the following settings:

Setting
Value

Property Name / Header

BOM Operations

Accessor

bomOperations

Primary Property

(Unmapped)

Secondary Property

mrp.bom.operation_ids

Update Odoo on Submit

true

Rendering Type

Advanced Multi Select List

List Display Selector

displayName

List Value Selector

id

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]**

[
    {
        "workCenterId": 2,
        "name": "Drill",
        "value": {
            "sequence": 10,
            "name": "Drill",
            "workcenter_id": 2,
            "time_mode": "manual",
            "time_mode_batch": 10,
            "time_cycle_manual": 60
        }
    },
    {
        "workCenterId": 1,
        "name": "Galvanize",
        "value": {
            "sequence": 20,
            "name": "Galvanize",
            "workcenter_id": 1,
            "time_mode": "manual",
            "time_mode_batch": 10,
            "time_cycle_manual": 60
        }
    },
    {
        "workCenterId": 3,
        "name": "Punch",
        "value": {
            "sequence": 30,
            "name": "Punch",
            "workcenter_id": 3,
            "time_mode": "manual",
            "time_mode_batch": 10,
            "time_cycle_manual": 60
        }
    },
]

Enabled

true

Prefer Odoo Value

true

** When creating this list, and you only want to read the values, you'll want to specify at least the Work center id, and the name of the operation. If you also want to write the values back to Odoo, then you'll have to specify the entire object required to add new operations and the default settings for the operation. Adding new work centers are not supported at the moment.

Some default BOM operation properties that are available are listed below. The list is not exhaustive and you may customize your own (See the Odoo Configuration options > Models > mrp.routing.workcenter):

Property
Type
Availability
Required for reading

active

bool

16, 17, 18

name

string

16, 17, 18

bom_id

integer

16, 17, 18

workcenter_id

integer

16,17,18

time_mode_batch

integer

16,17,18

time_cycle_manual

integer

16,17,18

note

string

16,17,18

sequence

integer

16,17,18

After adding the new Property Mapping, add an import rule

Setting
Value

Type

import

Name

Text Manipulation

Process for {Primary}

false

Process for Odoo

true

JavaScript expression

// TODO

Last updated