Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

How do I add a sale.order.line to existing sale.order via External API

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
sale.order.line
1 Antworten
5297 Ansichten
Avatar
Todd Hartman

(Odoo 17)

I have the sale.order​ id of an existing order. I want to append some items to it using the external web services API.

I can't seem to get the payload correct.

This is as close as I've gotten.

payload = [
    {
        'order_id': 1071,
        'product_id': 44623,
        'name': 'TEST LINE: Product Description',
        'product_uom': 1,
        'product_uom_qty': 1.0
     }
]
so_lines = models.execute_kw(db, uid, password,
                             'sale.order.line', 'create',
                             payload
                             )

When I run this, I get this error message.

xmlrpc.client.Fault: Fault 2: 'Record does not exist or has been deleted.\n(Record: product.product(44623,), User: 377)'

I know for certain that the product matching that ID exists because I just searched for it.

payload = [
  [
    [
      "id",
      "=",
      "44623"
    ]
  ]
]
product = models.execute_kw(db, uid, password,
                            'product.template', 'search',
                            payload)

And I get results the same ID back.

Can someone tell me what I'm lacking? Can I create sale.order.line​ items with create​ or do I have to use update​ for a sale.order​?

0
Avatar
Verwerfen
Todd Hartman
Autor

@Cybrosys, Thanks for the answer. (I'm unable to comment on your answer.) I updated my question with the actual error code (with bad chars stripped). When I try your code verbatim, I get the same result.

Todd Hartman
Autor

Does something need to be true about a product before I can add it as a line item on a sale order?

Todd Hartman
Autor

If I add the product in the web app, when I retrieve the `sale.order.line` data, the `product_id` doesn't match what I retrieved from `product.template`. Is there a different model that sale.order.line items link to?

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste Antwort

Hi,

You can create the values like

payload = {
    'order_id': 1071,
    'product_id': 44623,
    'name': 'TEST LINE: Product Description',
    'product_uom': 1,
    'product_uom_qty': 1.0
}

so_line_id = models.execute_kw(db, uid, password,
                               'sale.order.line', 'create',
                               [payload]
                               )

the payload is a dictionary, not a list of dictionaries.If you need to update an existing sale order instead of creating a new one, you can use the write method instead of create.
so_line_id = models.execute_kw(db, uid, password,
                               'sale.order.line', 'write',
                               [[sale_order_line_id], payload]
                               )


Hope it helps

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
How to add a sequence a field? Gelöst
sale.order.line
Avatar
Avatar
Avatar
2
Dez. 24
22122
add product upon saving sales order
sale.order.line
Avatar
0
Sept. 24
1491
Odoo 17 remove product_uom from sale_order_lines
sale.order.line
Avatar
Avatar
Avatar
3
Aug. 24
2932
invoice/sales
sale.order.line
Avatar
0
Feb. 24
2097
invoice
sale.order.line
Avatar
0
Feb. 24
1533
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Ausbildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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