Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Using Web Service API with Odoo v11: perform a call to a "onchange" function

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
apirpc
1 Atsakyti
8377 Rodiniai
Portretas
Mathieu Ferment


Hello,

I am trying to build an integration between my PHP website and the Odoo ERP of a customer. This customer is building his website using Odoo v11.
My first issue is that Odoo Web Service API Documentation is not available for v11 ^^ (link returns a 404: https://www.odoo.com/documentation/11.0/api_integration.html).

I am trying to create a "sale.order" object into the Odoo of my customer. My customer told me that I have to:

1) create a sale.order (I provide the partner_id)
2) then call the function "onchange_partner_id" on this sale.order so that it autofills some fields on the sale.order

Step 1) is OK but I cannot find how to do step 2). When I read Odoo Web Service API Documentation v8 (https://www.odoo.com/documentation/8.0/api_integration.html) I see that I can only call the "execute_kw" function and I cannot find how to do use it to call the "onchange_partner_id" function.

For Step 1, I do:

order_id = models.execute_kw(db, uid, password, 'sale.order', 'create', [{
    'name': "A new Order", 'partner_id': 17
}])

For Step 2, I tried:

onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [
    order_id
])
or onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [[
    order_id
]])

I get an error message "TypeError: cannot marshal None unless allow_none is enabled"

onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [[
    id: order_id
]])

I get "ERREUR:  syntaxe en entrée invalide pour l'entier : id
  LINE 1: ... "user_id" FROM "sale_order" WHERE "sale_order".id IN ('id')"

onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [[
    order_id: order_id
]])

I get "TypeError: cannot marshal None unless allow_none is enabled"

Best regards,

Mathieu Ferment

0
Portretas
Atmesti
Portretas
Bréndou Serge Eric
Best Answer

Hello Mathieu! I think you just need to instantiate your xmlrpc client like this:

models = xmlrpc.client.ServerProxy('your_url_here', allow_none=True)
as for step 2, i think this would work:

onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [
    order_id
]) 
or
onchange_result = models.execute_kw(db, uid, password, 'sale.order', 'onchange_partner_id', [[

    order_id
]).
0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
API - RPC : how to retrieve all products from a specific supplier ?
api rpc
Portretas
1
rugp. 17
9511
How can I pass a variable to .filtered to filter a recordset dynamically? Solved
api rpc filtering
Portretas
Portretas
Portretas
2
gruod. 23
20723
Has anyone integrated Helpdesk with Zoom for meeting scheduling?
api
Portretas
Portretas
1
rugp. 25
1290
Using API check if Odoo is using Odoo sh or on-premises hosting. Solved
api
Portretas
Portretas
1
rugp. 25
1676
External API XMLRPC Authentication Keeps Replying with false
api
Portretas
Portretas
Portretas
2
liep. 25
4569
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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