Source Table
mrp_productionSource Column
mp.idData TypeINTEGER
DescriptionPrimary key of the manufacturing order. Use as a unique identifier for Power BI relationships.
Complete field-level reference for the PostgreSQL view vw_frd_mrp_1_dashboard — every output column, its Odoo source table, and all calculated formulas explained with technical field names and SQL logic.
All PostgreSQL / Odoo tables referenced in the view
What does one row represent?
mrp_output_log → stock_move → stock_move_line, a single Workorder produces multiple rows when it has multiple output logs or move lines. Duration and cost fields are protected by ROW_NUMBER() OVER (PARTITION BY wo.id ORDER BY ol.id) = 1 guards so Power BI SUM aggregations do not double-count.Source: mrp_production (alias: mp)
mrp_productionmp.idmp.nameWH/MO/00123mp.statedraft · confirmed · progress · to_close · done · cancelmp.product_qtymp.qty_producingmrp_production → uom_uom (alias: mp_uu)mp.product_uom_id = mp_uu.idmp.create_datemo_summarymo_summarySource: mrp_workorder (wo) · mrp_workcenter (wc)
wo.idwo.namewo_name and workorder for Power BI flexibility.wo.statepending · ready · progress · done · cancelwo.qty_producedwo.duration_expectedwo.emp_durationemp_duration). Protected from row multiplication by the dedup guard.wo.total_actual_workcenter_timemrp_workcenter (wc)wc.namewo.workcenter_id = wc.id (INNER JOIN)wc_wo_countSource: product_product · product_template · product_category · product_format · src_type · src_category
mrp_production → product_product → product_template->>'en_US' operator extracts the English translation from Odoo's multilingual JSONB column.product_product (pp)pp.province_code — custom fieldproduct.product. Used for regional product filtering in Power BI slicers.product_format (pf) — custom tablept.product_format_id = pf.id (LEFT JOIN — nullable)product_template → product_category → src_typest.nameproduct_template → product_category → src_categorysc.nameSource: stock_move · stock_move_line · mrp_workcenter — mostly calculated
sm.product_uom_qty — stock_movesml.net_weight — custom field on stock_move_linesml.estimated_units — custom field on stock_move_linesm.product_uom = uu.idwo_scrap (LEFT JOINed on wo.id)vaporized_location_id or destruction_location_id on the workcenter = scrapped material.mrp_workcenter.employee_costs_hour × mrp_workorder.emp_durationmrp_workcenter.costs_hour × mrp_workorder.total_actual_workcenter_timeSource: mrp_output_log · product_product · product_template · stock_move · stock_location
| Alias | Source Column | Source Table | Description |
|---|---|---|---|
| output_log_id | ol.id | mrp_output_log | PK of the output log entry linked to this workorder |
| output_product_id | ol.product_id | mrp_output_log | Product recorded in the output log (may differ from MO product) |
| output_log_state | ol.state | mrp_output_log | State of the output log entry (e.g. draft, done) |
| product_id | ol_pp.id | product_product (via ol) | product.product ID for the output log product |
| product_template_id | ol_pt.id | product_template (via ol_pp) | product.template ID for the output log product |
| product_template_name | ol_pt.name->>'en_US' | product_template (via ol_pp) | English name of the output log product template (JSONB extraction) |
| stock_move_id | sm.id | stock_move | PK of the stock move linked to the output log |
| stock_move_state | sm.state | stock_move | State: draft / confirmed / done / cancel |
| location_id | sm.location_id | stock_move | Source location ID (FK to stock_location) |
| location_name | source_loc.name | stock_location (alias: source_loc) | Human-readable name of the source stock location |
| location_dest_id | sm.location_dest_id | stock_move | Destination location ID (FK to stock_location) |
| location_dest_name | dest_loc.name | stock_location (alias: dest_loc) | Human-readable name of the destination stock location |
All 49 output columns at a glance
| # | Alias | Type | Category | Formula / Source Summary |
|---|---|---|---|---|
| 1 | mp_id | INT | MO | mp.id |
| 2 | mp_number | VARCHAR | MO | mp.name |
| 3 | manufacturing_order | VARCHAR | MO | mp.name (duplicate alias) |
| 4 | mp_state | VARCHAR | MO | mp.state |
| 5 | mp_product_qty | NUMERIC | MO | mp.product_qty |
| 6 | mp_qty_producing | NUMERIC | MO | mp.qty_producing |
| 7 | mp_product_uom | VARCHAR | MO | mp_uu.name->>'en_US' |
| 8 | mo_creation_date | TIMESTAMPTZ | MO | mp.create_date |
| 9 | wo_id | INT | WO | wo.id |
| 10 | wo_workcenter_id | INT | WO | wo.workcenter_id |
| 11 | wo_name | VARCHAR | WO | wo.name |
| 12 | workorder | VARCHAR | WO | wo.name (duplicate alias) |
| 13 | wo_state | VARCHAR | WO | wo.state |
| 14 | wo_qty_produced | NUMERIC | WO | wo.qty_produced |
| 15 | wo_expected_duration | NUMERIC | WO Calc | CASE WHEN ROW_NUMBER()=1 THEN wo.duration_expected ELSE 0 |
| 16 | mo_expected_duration | NUMERIC | MO Calc | COALESCE(mo_summary.mo_expected_duration, 0) |
| 17 | duration_expected | NUMERIC | WO Calc | Same as wo_expected_duration |
| 18 | wo_duration | NUMERIC | WO Calc | CASE WHEN ROW_NUMBER()=1 THEN wo.emp_duration ELSE 0 |
| 19 | duration | NUMERIC | WO Calc | Same as wo_duration |
| 20 | total_actual_workcenter_time | NUMERIC | WO Calc | CASE WHEN ROW_NUMBER()=1 THEN wo.total_actual_workcenter_time ELSE 0 |
| 21 | workcenter | VARCHAR | WO | wc.name |
| 22 | product_name | VARCHAR | Product | pt.name->>'en_US' |
| 23 | province_code | VARCHAR | Product | pp.province_code (custom) |
| 24 | product_format | VARCHAR | Product | pf.name (custom table) |
| 25 | src_type | VARCHAR | Product | st.name (custom table) |
| 26 | src_category | VARCHAR | Product | sc.name (custom table) |
| 27 | demand_quantity | NUMERIC | Metric | sm.product_uom_qty |
| 28 | weight_produced | NUMERIC | Metric | sml.net_weight (custom) |
| 29 | estimated_units | NUMERIC | Metric | sml.estimated_units (custom) |
| 30 | uom | VARCHAR | Metric | uu.name->>'en_US' |
| 31 | quantity_produced_kg | NUMERIC | KPI | sml.net_weight / 1000.0 |
| 32 | workcenter_workorder_count | INT | KPI | COALESCE(COUNT(wo) per wc, 0) |
| 33 | mo_workorder_count | INT | KPI | COALESCE(COUNT(wo) per MO, 0) |
| 34 | labor_mins_per_unit | NUMERIC | KPI | wo.duration / NULLIF(sml.estimated_units, 0) |
| 35 | labor_hours_per_unit | NUMERIC | KPI | (wo.duration/60) / NULLIF(sml.estimated_units, 0) |
| 36 | labor_hours_per_kg | NUMERIC | KPI | (wo.duration/60) / NULLIF(sml.net_weight/1000, 0) |
| 37 | total_waste | NUMERIC | KPI | SUM qty to waste locations (wo_scrap subquery) |
| 38 | total_consumption | NUMERIC | KPI | SUM done qty NOT to waste locations (wo_scrap) |
| 39 | waste_loss_pct | NUMERIC | KPI | (total_waste / NULLIF(total_consumption,0)) × 100 |
| 40 | performance_pct | NUMERIC | KPI | ((duration_expected − duration) / NULLIF(duration_expected,0)) × 100 |
| 41 | labor_cost | NUMERIC | Cost | COALESCE(wc.employee_costs_hour,0) × (emp_duration/60) |
| 42 | workcenter_cost | NUMERIC | Cost | COALESCE(wc.costs_hour,0) × (total_actual_workcenter_time/60) |
| 43 | total_operation_cost | NUMERIC | Cost | (labor_cost + workcenter_cost) / NULLIF(emp_duration/60, 0) |
| 44 | fully_productive_time | NUMERIC | OEE | CASE ROW=1: LEAST(emp_duration, duration_expected) ELSE 0 |
| 45 | reduce_speed | NUMERIC | OEE | CASE ROW=1: GREATEST(0, emp_duration − duration_expected) ELSE 0 |
| 46 | output_log_id | INT | Log | ol.id |
| 47 | output_product_id | INT | Log | ol.product_id |
| 48 | output_log_state | VARCHAR | Log | ol.state |
| 49 | product_id … location_dest_name | MIXED | Log | product_product / product_template / stock_move / stock_location columns |