Odoo Manufacturing API: Working with mrp.production and mrp.bom
odoo manufacturing api
Also searched as
- odoo mrp.production api
- odoo create manufacturing order xmlrpc
- odoo bom api
Short answer
Odoo exposes manufacturing through its normal external API: the models mrp.bom (bills of materials), mrp.production (manufacturing orders) and mrp.workorder, called via XML-RPC or JSON-RPC with execute_kw. Authenticate, search and read the BOM, create a manufacturing order, then call its action methods such as action_confirm to move it through states. There is no separate manufacturing API.
Applies to: Odoo Manufacturing (MRP) in recent versions, Community and Enterprise. Field names and behaviour change between versions, so check your model definitions through the Technical menu or fields_get.
Create and confirm a manufacturing order over the API
- 1Authenticate to the common endpoint with database, login and password or API key, and keep the returned user id.
- 2Look up the product with search_read on product.product, and read the BOM with search_read on mrp.bom filtered by product_tmpl_id.
- 3Read the BOM lines from mrp.bom.line using the BOM id, to see components and quantities.
- 4Create the manufacturing order with create on mrp.production, giving product_id, product_qty, product_uom_id and bom_id.
- 5Call action_confirm on the new order to confirm it, which creates the stock moves for components and finished product.
- 6Check availability and state by reading state, reservation_state and move_raw_ids.
- 7To finish, set the produced quantity and call button_mark_done. Be ready for it to return a wizard action instead of finishing, if confirmation is needed.
A worked example in Python
This uses the standard xmlrpc.client library. Replace the connection values with your own. Test on a copy of the database, since creating and confirming orders reserves stock.
import xmlrpc.client
url, db, user, key = 'https://odoo.example.com', 'mydb', 'api@example.com', 'API_KEY'
common = xmlrpc.client.ServerProxy(url + '/xmlrpc/2/common')
uid = common.authenticate(db, user, key, {})
m = xmlrpc.client.ServerProxy(url + '/xmlrpc/2/object')
def call(model, method, *args, **kw):
return m.execute_kw(db, uid, key, model, method, list(args), kw)
prod = call('product.product', 'search_read', [['default_code', '=', 'FG-100']], fields=['id', 'uom_id'], limit=1)[0]
bom = call('mrp.bom', 'search_read', [['product_tmpl_id.default_code', '=', 'FG-100']], fields=['id'], limit=1)[0]
mo_id = call('mrp.production', 'create', [{'product_id': prod['id'], 'product_qty': 10, 'product_uom_id': prod['uom_id'][0], 'bom_id': bom['id']}])
call('mrp.production', 'action_confirm', [mo_id])
print(call('mrp.production', 'read', [mo_id], fields=['name', 'state', 'reservation_state']))States and methods to know
A manufacturing order moves through draft, confirmed, in progress, to do, done and cancel states, although labels vary by version. The action methods are what the buttons on the form call, for example action_confirm, button_plan for work orders, button_mark_done, and action_cancel.
Some of those methods return a dictionary describing a wizard, for example a warning about consumption or an immediate production prompt. An integration must check the return value, and either handle the wizard model or set quantities first so the wizard is not needed.
Practical advice for integrations
Use fields_get on mrp.production to see what fields your version supports, and read only the fields you need. Avoid reading every field on large orders.
For many records, batch calls rather than one request per record. Use an API key for a dedicated integration user with only manufacturing rights, so you can revoke it without affecting people.
Odoo's external API is documented by Odoo, and JSON-RPC and XML-RPC are both supported. Check which one your version recommends, since newer releases have been evolving the external API.
Try it here, free
Odoo XML-RPC BOM Export Python Script Generator
Fill in your Odoo URL, database and filters to get a ready Python script that exports BOMs and component lines to a CSV file.
Common pitfalls
- !Writing stock moves directly instead of using the order methods.
- !Ignoring the wizard dictionary returned by button_mark_done.
- !Using an admin account for the integration.
- !Testing on production, so reservations pile up.
- !Assuming field names are the same across versions.
- !Creating orders without a BOM and wondering why components are missing.
How an ERP-grounded AI assistant handles this
Read access to mrp.production and mrp.bom is a good fit for a grounded assistant that answers which manufacturing orders are late or blocked on components. Writes such as confirming an order should go through a human approval step. Hosting the model on-prem keeps BOMs and production data inside your network.
Frequently asked questions
Does Odoo have a manufacturing API?
It uses the general external API (XML-RPC and JSON-RPC) with manufacturing models such as mrp.production and mrp.bom, rather than a separate API.
How do I create a manufacturing order via API?
Call create on mrp.production with product, quantity, unit of measure and BOM, then call action_confirm.
How do I read a BOM?
Search mrp.bom for the product, then read mrp.bom.line records for the BOM id to get components and quantities.
Why does button_mark_done not finish the order?
It may return a wizard action, such as an immediate production or consumption warning. Handle that wizard or set quantities first.
Related
Odoo External API: Authenticate and search_read with XML-RPC and JSON-RPC
Call the Odoo external API by authenticating against /xmlrpc/2/common to get a user id, then calling execute_kw on /xmlrpc/2/object with the database, uid, password or API key, model name, method and arguments. If authenticate returns False, the database name, login, or API key is wrong, or two-factor is enforced for that user.
Error fixOdoo Manufacturing Order: Components Not Available or Will Not Reserve
An Odoo manufacturing order stays in Confirmed with components marked Not Available when stock.move lines for the raw materials cannot be reserved from the quantity actually sitting in the MO's source location. The usual causes are stock in the wrong location, stock already reserved by another document, lot or tracking mismatches, and a unit of measure difference between the BoM and the product.
How-toOdoo Reordering Rule Not Creating Manufacturing Orders: Causes and Fixes
Odoo creates a manufacturing order from a reordering rule only when the rule's forecast quantity falls below its minimum, the product has the Manufacture route with an active BoM, and the replenishment scheduler actually runs. Check the rule's route and warehouse, the product's forecast, the BoM, and the scheduler cron, in that order.
How-toHow to Create a Generic Inquiry in Acumatica
Generic Inquiries (GI) are Acumatica's no-code query builder for joining tables, adding filters, and exposing the result as an inquiry screen, dashboard data source, or API endpoint. Open System > Customization > Generic Inquiry, add your base table, define joins and conditions, then run and save. No SQL or customization project is required.
Error fixFix Odoo AccessError: You Are Not Allowed to Access Records
Odoo raises AccessError when a user's security groups do not grant a CRUD right on a model through ir.model.access.csv, or when an ir.rule record rule filters the specific record out for that user or company. Fix it by adding the user to the group named in the error, editing the model's access rights, or reviewing the record rule's domain under Settings > Technical > Security.
How-toHow to Void a Check in Sage 100
Sage 100 voids checks through Accounts Payable > Main > Check and Payment Voiding. Select the bank code, choose the check number, and Sage reverses the Cash Disbursements Journal entry and reopens the invoice it paid. A check that already cleared in Bank Reconciliation or falls in a closed period needs an extra step before it can be voided cleanly.
AI for ERPAI for Odoo Manufacturing That Reads Your Own Database, Not a Vendor's Cloud
Add grounded, natural-language AI to Odoo Manufacturing without sending MRP, BoM, or work order data to a public model. On-prem or private cloud, ORM-native.
AI for ERPAI Agents for ERP, Running On-Prem
A practical guide to on-prem AI agents for ERP: what they can safely automate, where human approval belongs, and how to design the guardrails.
Stuck on Odoo (Manufacturing / MRP)?
Talk to engineers who work inside Odoo (Manufacturing / MRP) every week, and who build private AI that answers these questions from your own ERP data.
Keep exploring
Free tools
- Odoo XML-RPC BOM Export Python Script GeneratorFill in your Odoo URL, database and filters to get a ready Python script that exports BOMs and component lines to a CSV file.
- Odoo Manufacturing Setup ChecklistA practical checklist for configuring Odoo Manufacturing from inventory foundations through BOMs, work centers, planning and go-live.
- Odoo Manufacturing Technical Model Names ReferenceSearchable lookup of the Odoo models behind manufacturing, inventory, purchasing and sales, with the fields you query most.
ERP fixes and how-tos
- Odoo External API: Authenticate and search_read with XML-RPC and JSON-RPCHow to call the Odoo external API with XML-RPC or JSON-RPC: authenticate, API keys, search_read, create and write, plus why authenticate returns False.
- Odoo Manufacturing Tutorial: From BOM to Finished ProductOdoo manufacturing tutorial for small manufacturers: set up products, BOMs, work centers and operations, run a manufacturing order, and what to check in Odoo 19.
- Self-Hosted Odoo AI Assistant: Private Architecture With a Local ModelAdd a private AI assistant to self-hosted Odoo: external API with user API keys, record rules respected, PostgreSQL replica, local model and audit trail.
AI on your ERP
- AI for Odoo Manufacturing (MRP): BOMs, Work Orders and ShortagesAI for Odoo Manufacturing: BOM checks, work order delays, reordering rules and plain-language questions over mrp.production data, on-prem or private cloud.
- AI for Odoo Manufacturing That Reads Your Own Database, Not a Vendor's CloudAdd grounded, natural-language AI to Odoo Manufacturing without sending MRP, BoM, or work order data to a public model. On-prem or private cloud, ORM-native.
Integrations
- How to add AI agents to OdooHow to add AI agents to Odoo Manufacturing: a tool layer over the external API, approval before writes, and agents for MRP exceptions, POs and quality.
- How to build an MCP server for OdooHow to build an MCP server for Odoo: which tools to expose, API key auth, stdio versus HTTP, permission scoping and audit for Claude, ChatGPT and others.