Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivouspalvelut
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Kurssit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

Open ERP v7 - How do I execute a wizard via XML RPC?

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
xmlrpc7.0wizards
2 Vastaukset
14480 Näkymät
Avatar
Sam Davey

I'm integrating a PHP application with OpenErp and I am able to easily hook up via XMLRPC. Given the GTK client used to operate via XMLRPC (pre v7) its no surprise that i can achieve nearly anything through XMLRPC.

I've got the simple operations sorted; create, search, read etc. I can run any particular method using the execute call and i can trigger workflows using exec_workflow.

The missing part of the jigsaw is wizards. I can see that wizards changed in OpenERP 7.0 from wizards into TransientModels. I can also find info about how the 'wizard' operation in XMLRPC has been deprecated in OpenERP version 7 and I once saw that it is now part of the relevant objects orm although I can't find that article now.

But I can't find any examples or information about how to execute a wizard in OpenERP version 7 via XMLRPC.

The actual wizard I want to run is linked to the button 'Return Products' which is on a Delivery Order once it has been delivered.

How can I mimic the web client User Interface process of pressing the 'Return Products' button and filling in the corresponding form that pops up?

Does anyone have any examples to achieve this? Any programming language will do, I'll port it into PHP myself once I know how it works.

1
Avatar
Hylkää
Avatar
Sam Davey
Tekijä Paras vastaus

I'm not surprised no one has answered this. There is no magic 'run wizard' XMLRPC call. It's a series of calls.

As per the documentation "Everything done in the GTK or web client in OpenERP is through XML/RPC webservices. Start openERP GTK client using ./openerp-client.py -l debug_rpc (or debug_rpc_answer) then do what you want in the GTK client and watch your client logs, you will find out the webservice signatures."

I was thrown by this as I can't use the client with version 7. But of course the web client essentially does exactly the sae thing as the GTK client so I just needed to turn on debugging on the server and watch the logs for the webservice signatures.

So to do this you just add "log_level = debug_rpc_answer" to your server config file (openerp-server.conf in my instance)

Once I'd done that I could see what was going on and replicated it in PHP.

I'm not going to go into detail here. If you need to do the same then you just need to get to 'debug_rpc_answer' and start analysing the webservice signatures.

But for completeness the process looks like this

  • Fill in the context for the call
  • Call default_get to get the data for the wizard
  • Alter the data as needed then call create, this creates an object in memory and returns an identifier for it
  • In my case I then call 'create_returns' which converts the in memory object into the corresponing incoming shipment record

Heres how it looks although I've stripped out some bits

// First build the context of the request, i.e. in my case the Delivery Order I am creating a return for
$activeId = 7;

$args = array(
    array(
        'product_return_moves', 
        'invoice_state'
    ),
);

$context = array(
    "context" => array(
        'active_id'=> $activeId,
        'active_ids'=> array($activeId),
        'active_model'=> 'stock.picking.out',
        contact_display'=> 'partner_address',
        'default_type'=> 'out',
        'lang'=> 'en_GB',
        'search_disable_custom_filters'=> True,
        'tz'=> 'Europe/London',
        'uid'=> 1,
    ),  
);

// Call 'default_get' which returns all the data that gets filled in the UI when you click 'Return Products'

$results = $client->call('execute_kw', array($dbName, $user, $pwd, 'stock.return.picking', 'default_get', $args, $context));

$previousMoves = $results['product_return_moves'];

// Do stuff with previousMoves to build the actual productReturnMoves needed
... omitted for brevity ...

$args = array(
        array(
            'invoice_state' => 'none',
            'product_return_moves' => $productReturnMoves,
        ),
    );

$results = $client->call('execute_kw', array($dbName, $user, $pwd, 'stock.return.picking', 'create', $args, $context));

// An identifier for this 'in memory' (TransientModel) object is returned
$wizardId = $results;

// Call the method that converts the 'in memory' (TransientModel) object into corresponding object
$args = array(
        array($wizardId),
        $context["context"],
    );

$blank = array();

$results = $client->call('execute_kw', array($dbName, $user, $pwd, 'stock.return.picking', 'create_returns', $args, $blank));

Easy... Or not... depending on how impressed or frustrated you are feeling about OpenERP today :-)

4
Avatar
Hylkää
Timothy Solomon

Thanks for sharing your answer :) Wizards are just temporary models to work on other models - so best to look at what the wizard does (eg create a incoming shipping order when you click on "return products"). I usually figure out what the code does and then try and reproduce it with RPC, but checking the rpc log is a good idea!

Avatar
florent.uagolf@gmail.com
Paras vastaus

Hi !

Thanks both of you !

So I created a multiple action automated task :
- 1st : send email with quotation
- 2st : change field 'state' to 'sent' but this cannot be done directly with the update so I need to do something like this in python :
request.env['sale.order'].sudo().write({'state':'sent'})

Is that right ?

0
Avatar
Hylkää
Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
OpenERP 7.0 WebService : search_read()
php xmlrpc 7.0 webservice
Avatar
Avatar
2
kesäk. 15
7386
xmlrpc Error when attempting to connect to my local instance Ratkaistu
xmlrpc
Avatar
Avatar
Avatar
3
heinäk. 25
4588
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
lokak. 24
3239
How to run a method from external api as the superuser
xmlrpc
Avatar
Avatar
1
huhtik. 24
3304
<methodName>execute</methodName>
xmlrpc
Avatar
0
syysk. 23
2599
Yhteisö
  • Kurssit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Brändiominaisuudet
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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