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 is the relationship between sales order and purchase order created

Subscribe

Get notified when there's activity on this post

This question has been flagged
salesrelationshipchangePurchase
1 Reply
10142 Views
Avatar
Herbert Van de Poel

We are a service company; we have created products that are purchased automatically when they are sold to our customer. This creates a smart button on the sales order to the purchase order, and the other way around. 

However, I want to change the relationship and link an other purchase order to the sales order. Where can I change this relationship - I would like to fix this using studio


any insights much appreciated

0
Avatar
Discard
Jamshid Chungath

You can set vendor in the product, and set buy routes and Make to order, this will generate a purchase order whenever you make sales order for that product

Avatar
Herbert Van de Poel
Author Best Answer

Finally I managed to find the answer myself. The link between purchase order and sales order is not created on the level of the orders, but on the level of the order lines. Actually, in our case where we subcontract a service we sell, by setting the product (service) as being outsourced, whenever a SO is validated, this triggers the creation of a PO for the respective supplier. 

By using Studio, you can modify the PO order lines section in the form view. Add the field "Sale_order_id" to it, and make sure this field is not 'read only'. (this can be achieved by adding a domain to the 'read only' flag (like e.g. Id is not set). And for security reasons, make sure this field is only visible to certain user groups. 

Now you can edit / add / link the purchase order line to the sales order it should be linked to. In addition, you can even add the sales order line on the above mentioned list view, so that you can back link the purchase order line to the original sales order line. 

By going back to the sales order, you will find that the smart button in the top corner now links to the adapted PO.

Glad I could help myself (and others.)

0
Avatar
Discard
Prih Hatmoko

Hello Herbert,

I'm interest about this, because I have same problem too.

I try this tutorial but I can't find it. This field is existing in Po Order Lines or we need to add new relation field?

Btw, I'm using odoo v16

Thank you,

Ignacio Fernández

@Prih Herbert you have to add it: "Add the field "Sale_order_id" to it, and make sure this field is not 'read only'. (this can be achieved by adding a domain to the 'read only' flag (like e.g. Id is not set)."

Jeff MacKenzie

i have tried adding this field you mention with the flag to prevent read only to the purchase order forms and it doesnt work, we are using version 17, is there anyway you can add screenshots or a step by step of which field should be added to what part of the form?

A S

I believe this is only true for real dropship processes, i.e. if supplier is sending directly the product to customer.

For ordinary PO - SO relations (so someone orders a product which is not on stock but has to be bought via PO first, delivered to your WH and then send to customer), it seems that procurement groups are used to establish link. See code here: https://github.com/odoo/odoo/blob/17.0/addons/sale_purchase_stock/models/purchase_order.py#L14

For us, on purchase.order.line, the sale_order_id and sale_order_line are empty. They are only store values when a true dropship process is used.

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
XLS mistake in sales report pivot
sales relationship
Avatar
Avatar
1
Apr 23
2128
How to move order line from one module to another module?
sales odoo Purchase v15
Avatar
Avatar
1
Sep 22
3707
Modify confirm Sale Order
sales manufacturing orders change
Avatar
0
Mar 15
7341
community v10 vs v14
sales invoicing Purchase Inventory Accounting
Avatar
Avatar
1
Sep 22
2906
How to allow quotation requests (RFQ) from the eCommerce instead of direct sales
sales
Avatar
Avatar
Avatar
2
Dec 25
1500
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