Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to Link Invoice To Sales order in odoo 15

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
4 Antwoorden
6992 Weergaven
Avatar
Ahmed Gamal Khalil

i am doing migration to odoo 15 and i am uploading the Sales order and invoices separately 
so in there is any way to link sales order to the invoice after i uploading them ? 

 

0
Avatar
Annuleer
Julien Plaitin

Hello Ahmed,

Any answer ?

Thanks

Ahmed Gamal Khalil
Auteur

Hello Julien
unfortunately i got no answer
and for now i still don't have answer of this question

Micheal KARL

hello together, did you found a solution for linking a invoice to an existing SO?

thx, michael

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

Hi,

If you are familiar with code you can try the following.

In the sale order, we have a many2many field named invoice_ids. The invoice corresponding to the sale order is linked there.

So you can create a one-time running code and by searching the corresponding invoice id   and you can Update that to the sale order record

def update_invocie_ids(self):
sale_ids = self.env['sale.order'].search([])
for sale_id in sale_ids:
inovice_id = self.env['account.move'].search(["YOUR CONDITION TO MATCH THE RECORD"])
sale_id.write{(
'invoice_ids': [(4, "YOUR INVOICE IDS")],
)}

Regards

1
Avatar
Annuleer
Avatar
Jerome Sonnet - ITO MANAGEMENT FZCO
Beste antwoord

Correct way to do this is if the sale order and the invoice has just one line that match is :

# Assume you already have the sale order and invoice records
so = self.env['sale.order'].browse(SALE_ORDER_ID)
inv = self.env['account.move'].browse(INVOICE_ID)

# 1. Link invoice to sale order
inv.invoice_origin = so.name

# 2. Get the only line from each
so_line = so.order_line[0]
inv_line = inv.invoice_line_ids[0]

# 3. Link invoice line to sale order line
inv_line.sale_line_ids = [(6, 0, [so_line.id])]

# 4. Optional: Set analytic account if needed
if so.analytic_account_id:
    inv_line.analytic_account_id = so.analytic_account_id.id

# 5. Optional: Link invoice back to sale order (inverse)
so.invoice_ids = [(4, inv.id)]

inv.message_post(body=f"Linked manually to SO <b>{so.name}</b>")
so.message_post(body=f"Linked manually to Invoice <b>{inv.name}</b>")

0
Avatar
Annuleer
Avatar
tony odoo
Beste antwoord

 You cannot edit the invoice_ids field because it is a computed field.

It updates the order lines with the corresponding invoice lines.

it ensures that the invoices are correctly related to the sales

0
Avatar
Annuleer
Avatar
Fernando Huacuja Mena
Beste antwoord

This is a very good question! actualy I have same problem... @julien did you find a way?


What I found in other  posts is the following:



Hi,

If you create sale order and  the invoice, Then to link the invoice with the sales, you can add the id's of the invoices you have created to the field name invoice_ids in sale.order model.  This is a many2many field.


0
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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