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

Inventory Moves with MES Integration

Subscribe

Get notified when there's activity on this post

This question has been flagged
manufacturingintegration
3 Replies
3060 Views
Avatar
David Schultz

I am working on an MES integration with Odoo for a control system. I am able to select a manufacturing order, start production, modify produced and consumed quantities, and end production. However, while inventory moves are registered, they are not updated in inventory (quantity available). 

I execute read/write methods on the following models for the integration: 

​mrp.production

​stock.move

​stock.move.line

​product.template

I also create a stock.valuation.layer record for all of the material. 

Everything executes as expected, except when the production is complete. none of the inventory quantities adjust.

Thoughts?

0
Avatar
Discard
Avatar
Lars Aam
Best Answer

I would think to process as it would have been done with manual entry.

In settings for manufacturing you must have flagged "Unlock manufacturing orders" to allow flexible consumption.

Be sure that you have set Flexible Consumption to Allowed in the BOM, and Manual consumption is flagged for the components.  (I assume you do not.

You must make sure you have filled the field qty_done in the stock move line for the components, which is the actual consumed qty.  Else you will only post what is planned.  

For produce fill the field qty_producing in mrp.production.

The result should be that the order get status = To close (field state in mrp.production).

Use the action "button_mark_done" and (of course) select only the actual manufacturing order.  You will use the standard Odoo processing. It will do several posting in the background: Material movements, Accounting entries, and product valuation.  So you should not need to send anything to stock valuation layer or stock.move.

But for Button Mark done action I have configured an automatic action, that run when field state is changed into "To Close". 

model.search([('state', '=', 'to_close')]).button_mark_done()

Why do you update in product.template? Product template is masterdata, and it is not logic to update when processing confirmation of manufacturing?

Hope this helps you.


0
Avatar
Discard
David Schultz
Author

Lars,

Thank you for your help. I did not have the "Unlock Manufacturing Orders" checked. It appears this was the missing piece. I have outline additional steps needed.

Flexible Consumption was Allowed.

There is not a field "qty_done" in stock.move.line model. In stock.move the field "quantity" is updated to reflect material in actuals. This will create/edit lines in stock.move.line model.

I need to set the field "picked" to True in stock.move model. Otherwise materials in will not be consumed.

In mrp.production model, "qty_producing" is updated with the material out actual quantity. As you note, this will update field "state" in the same model.

Executing the "button_mark_done" method on mrp.production model outside of Odoo will result in an error, but it appears this is due to the forms that are generated in the method, but cannot be.

The product.template model was only used to create the stock.valuation.layer for materials. Only read method was used, and is no longer required.

Thank you, again, for your help. It is truly appreciated.

Avatar
David Schultz
Author Best Answer

Rajesh,

Thank you for your help. The "action_confirm" will set the state of a MO to Confirmed. I have tried using the "button_mark_done", but this only consumes material request (BOM) quantities, not material actual quantities. For example, if a MO requests 25 units of a product, but 26 are consumed, this method will only consume 25 in production inventory.

Please note I edited my original post as the stock.move and stock.move.line models were incorrect.

David

0
Avatar
Discard
Avatar
Rajesh R
Best Answer

Hello David,

Assuming that you are calling xml-rpc calls for your MES integration,
and in that if you are marking your M-order done via rpc call to 'action_confirm' (like odoo UI does the thing) then it should take care of all the stock effects


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
[$$ LATAM $Book Your Journey$] ¿Cómo se llama LAN ahora?
manufacturing
Avatar
0
Nov 25
5
Is it possible to integrate Webflow into Odoo? If yes, is there any documentation on this?
integration
Avatar
Avatar
1
Nov 25
7237
How to make Odoo schedule manufacturing in parallel?
manufacturing
Avatar
0
Oct 25
486
Change in Work Center Productivity Accounting
manufacturing
Avatar
Avatar
1
Sep 25
1308
How to disable form view if there are not registers?
manufacturing
Avatar
Avatar
2
Sep 25
988
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