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

Odoo Studio customer name on manufacturing order

Subscribe

Get notified when there's activity on this post

This question has been flagged
manufacturingstudio
4 Replies
5806 Views
Avatar
Kent Koski

Hello, Im new to Odoo Studio and Im trying to figure out how to add the Customer name from a Sales order to a Manufacturing Order.  Does anyone have an online example or an explanation they can share to point me in the right direction?

0
Avatar
Discard
Lucas

How are you creating the manufacturing order?

Kent Koski
Author

The manufacturing orders are created at confirmation of the Sales Order.

Lucas

Are they generated by reordering rules or the Replenish on Order (MTO) route?

Kent Koski
Author

Hi Lucas. They are generated with Replenish On Order (MTO).

Lucas

I have a solution for you, I will post the answer here

Kent Koski
Author

Awesome. Thank you for your help.

Avatar
Lucas
Best Answer

When you confirm a sales order that contains a product with the MTO Route, then the 'Source' field on the 'Miscellaneous' tab on the manufacturing order will contain the Sales Order number as a text field.

We can use this to create a firm link between the Sales Order and Manufacturing Order.

Firstly, open Studio on the Manufacturing Order and add a 'Many2One' field that is linked to the 'Sales Order' model.

Secondly, create an automated action with the following settings:

- Model: Production Order

- Action To Do: Update the Record

- Trigger: On Creation

- Field: (Select the custom Many2One field that is linked to the sales order model)

- Evaluation Type: Python Expression

- Value: record.env['sale.order'].search([('name','=',record.origin)])

Thirdly, Add a Related Field on the Manufacturing Order using Studio. Use the path Sales Order > Customer > Display Name

Now, when a Sales Order is confirmed the Manufacturing Order that is generated will be formally linked to the Sales Order and the related field will pull through the customer name from that Sales Order. You can also add more related fields to pull any other fields from the SO, e.g. customer phone number etc.

Please let me know if this works for you

1
Avatar
Discard
Kent Koski
Author

Thank you so much. I will give it a try and let you know.

Kent Koski
Author

So on the 1st field I see it is pulling in the Sales Order number. However, on the Related Field it is not bringing in the customer name. I made sure to delete all my manufacturing orders, cancel the sales order, then confirm it again to create new records. Any ideas?

Lucas

You can manually select the Sales Order number in the Many2One field to test if the related field is pulling the correct data through. It is easier to test the link manually rather than creating a new sales/manufacturing order.

Open Studio, select the related field and check the 'Related Field' box in the left hand pane and make sure it says something like:
x_studio_many2one_field_9yWzD.partner_id.display_name

It must say partner_id.display_name , please check that

Kent Koski
Author

The Related Field value is: x_studio_sales_order.partner_id.display_name

Lucas

Which Odoo version are you on?

Kent Koski
Author

Im doing a trial of Odoo so it should be latest. Im preparing for a test run and we will then subscribe.

Kent Koski
Author

I noticed when I was adding the Related Field there were multiple Sales Order values listed. I took the first one. Im not sure why so many are listed. I was thinking about creating another test database to try your steps again. It seems like it should work.

Lucas

If there were multiple Sales Order values listed then it means that you have added multiple Many2One fields referencing the Sales Order model

Kent Koski
Author

Yea, I just created a new database and did it again and it worked! I did create many fields trying to figure this out. Thank you so much for your help. I have a better understanding of how Studio works now too.

Lucas

You are welcome, I had the same requirement and spent waaaaay too long trying to figure it out.

The automated action will only update one Many2One field with the SO number. If you have multiple Many2One fields (from testing etc) you have to make sure the related field is referencing the correct one.

Good luck!

Avatar
Mindaugas
Best Answer

hi, this is realy good starting position help. try it.
https://odootricks.tips/about/odoo-studio/

1
Avatar
Discard
Avatar
Aunchalee
Best Answer

How about not have "related field" in Odoo 16 and 17 What can i ues?

0
Avatar
Discard
Avatar
Pieter Van Den Weghe
Best Answer

Hi,

Lucas's example is good, but it still requires manual selection of the sales order in the Manufacturing Order in order to display the customer name. With the following solution you will immediately enter the customer name when creating the production order:

1. Go to a Manufacturing order and open Odoo Studio

2. Add a 'Many2One' field that is linked to the 'Sales Order' model.

3. Add a Related Field on the Manufacturing Order using Studio. Use the path Sales Order > Customer > Display Name. Give it a technical name x_studio_production_customer
4. C
reate an automated action with the following settings:

- Model: Production Order

- Trigger: On Creation

- Action to do : Python Expression

- The Python code

order = record.env['sale.order'].search([('name','=',record.origin)])
if order:
​record.write({'x_studio_production_customer': order.partner_id.name})

Good luck!

-1
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
Comment afficher un champ personnalisé de type Float du modéle mrp.workcenter.productivity dans un tableau croisée dynamique
manufacturing dashboard studio
Avatar
Avatar
1
Jun 25
779
[v16] Information from Sales Order to MO
manufacturing sale.order studio
Avatar
Avatar
1
May 25
3410
Delivery Date Shown In Manufacturing Order
sales manufacturing studio
Avatar
Avatar
1
Mar 23
2712
How can I link Sales Order information to a Manufacturing Order? Solved
manufacturing studio v15
Avatar
Avatar
Avatar
3
May 25
8425
debit and credit in currency
studio
Avatar
Avatar
1
Nov 25
2095
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