Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to create manufacturing order (with s/n) via API

Subscribe

Get notified when there's activity on this post

This question has been flagged
manufacturingapiserial_number
3014 Views
Avatar
Jan Frey

Hello, 

I am struggling to implement creation of manufacturing orders via XML RPC API.

The particular challenge here: both (some of) the components _and_ the finished product are tracked by serial number. My goal is to create a manufacturing order for a whole batch of the product (let's say 500 pieces), then break it down in to 500 backorders (1 piece each, carrying the S/N of the finished products and having the components serial numbers tracked).

It looks like I found a way to achieve it, but to me it looks like plain DB manipulation and I am afraid it is preventing normal checks being applied and thus potentially leading to an inconsistent data base?

My approach works like this:

1. Create manufacuring order for X pieces and call "action_confirm" & "action_assign" on it

2. This fills the "move_raw_ids" and "move_raw_line_ids" in the MO

3. I'm setting the "lot_producing_id" to the desired S/N of the finished product

4. In the "move_raw_ids" stock moves I am setting "next_serial" to the S/N and "should_consume_quantity" to 1

5. In the stock move I am setting in every move line: lot_id,  qty_done, is_completed, manual_consumption.

6. Then I'm creating a record in stock.assign.serial with all the serial numbers for all the products to be produced, and finally

7. I am calling "apply" on it which is creating all the backorders.


Is this the right way of doing it? How would it be done when doing this through the UI manually?

I'm a bit afraid as I realized during my testing that you can even execute the manufacturing orders created when some of the components are not available - leading to negative inventory and similar things...

Any general suggestions about how to create "mass" manufactoring orders with serial numbers?

Thanks in advance for any furthe hints..

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Manufacturing - how to assign individual serial numbers to produced products
manufacturing mrp serial_number
Avatar
0
Oct 22
5015
[MANUFACTURING APP] Mass Produce feature in v15
manufacturing production serial_number
Avatar
Avatar
1
Jul 22
4585
Where to print barcode labels (product and/or serial numbers) during Manufacturing
manufacturing barcode serial_number
Avatar
0
May 20
4290
Reserve a specific Serial Number Solved
manufacturing inventory serial_number serial_numbers
Avatar
Avatar
1
Mar 23
3798
How can you assign Unique Serial Numbers to an Manufactured part and all it's Component defined in a BoM and how can you track these? Solved
manufacturing tracking bom serial_number
Avatar
Avatar
2
Nov 22
4655
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now