Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to add a related field coming from a sales order on an invoice?

Naroči se

Get notified when there's activity on this post

This question has been flagged
quickstartStudio
2 Odgovori
7608 Prikazi
Avatar
Quentin Coussement (qco)

If we add a related field on an invoice with Studio, you won't be able to find fields coming from the related sales order.

How can we create this field then?

0
Avatar
Opusti
Quentin Coussement (qco)
Avtor

Update: Since V15.0, you should first create your field with Studio then you can add the related.

For example, if the related field you want to create is a date:

1: Create a date field with Studio
2: Add the related on the field

It's really important that you directly create your Studio field with the right type.

Avatar
Quentin Coussement (qco)
Avtor Best Answer

Activate the debug mode and go to Settings > Technical > Database Structure > Fields


Create a new field and give it a name. Since we want to add it on an invoice, the model is “Journal Entry”.

 


If your invoice was created from a sales order, each invoice lines are linked to a sale order line.

So we need to create the related by field by retracing the way from the invoice line to the field you want on the sales order.


The expression you need is: invoice_line_ids.sale_line_ids.order_id


This field will give you the sales order related to the invoice. If you want a specific field from the sales order, for example the order date then I juste need to add .date_order at the end of the expression.


So: invoice_line_ids.sale_line_ids.order_id.date_order

 

Now that the field is created, you can add it on the view with Studio.


 

Be careful that it will only work correctly if the invoice was created from only one sales order.

If you have several sales order related to the invoice, the related field will take the sales order linked to the first invoice line.

5
Avatar
Opusti
Avatar
Janice
Best Answer

Hi Quentin, thanks for that. I was wondering if you would be able to help out with adding a related field on Vendor bills to the related Purchase order with Studio. Thanks in advance.

0
Avatar
Opusti
Quentin Coussement (qco)
Avtor

Hello Janice,
It's the same logic but you have to use purchase_line_ids instead of sale_line_ids in the expression for the related field.

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
How to filter the customers in the Sales Order for the salesperson? Solved
quickstart Studio
Avatar
1
mar. 23
3630
Studio : add a specific field (SIRET) in the header of PDF documents
quickstart Studio
Avatar
0
jul. 21
444
How to link a document in the document app to a record in a model in the db ? Solved
document quickstart Studio
Avatar
1
maj 22
5571
Studio : how to change the layout header based on sale order specific values? Solved
layout quickstart Studio
Avatar
1
maj 22
6513
Print Quality Report PDF's
quickstart Studio Quality
Avatar
0
dec. 21
3811
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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