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

Web Services Tutorial Odoo/PHP

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
webphpservices
2 Antwoorden
35467 Weergaven
Avatar
Thierry Godin

Hello all,

I just published a new tutorial about Web Services.

For now, it's only in french. US translation 's coming soon.

http://thierry-godin.developpez.com/openerp/openerp-xmlrpc-php-fr/

5
Avatar
Annuleer
Yenthe Van Ginneken (Mainframe Monkey)

@Thierry, what would be the best way to work from Android to Odoo? Could you then best direct from Android to mySQL / PHP and then too Odoo? Or would there be a way to send from Android to Odoo instantly? Thanks for the tutorial, its great.

Thierry Godin
Auteur

@Yenthe , Sorry mate, I don't know Android programming. I cannot help you for this :(

Avatar
Thierry Godin
Auteur Beste antwoord

The english version of the tutorial is here :

http://thierry-godin.developpez.com/openerp/openerp-xmlrpc-php-en/

The files of the scripts can be downloaded here :

http://www.lapinmoutardepommedauphine.com/openerp/odoo_xmlrpc_php_files.zip

7
Avatar
Annuleer
ThackerS (ts)

Good job Thierry. I wait the tutorial on odoo interface customization.

Yenthe Van Ginneken (Mainframe Monkey)

Thank you for sharing this Thierry! This is a goldmine of basic information to learn from.

Ashish Singh

Thnaks Thierry Godin ...

Avatar
charles
Beste antwoord

Hi Godin,

I'm new to odoo and have just successfully installed odoo under Ubuntu in Oracle Virtual Box (virtual machine), which is running under windows 8. Luckily, everything is fine by using the application. 

Your tutorial is great, thanks a lot. I followed your example code (copied below) to practice. Unfortunately, the PHP program stopped at this statement "$connexion = new xmlrpc_client($server_url . "/xmlrpc/common");". And there were no error messages shown at all. 

Can you provide further help?

1. Are there any error messages to trace what happen?

2. Are there any system settings in odoo before I can use PHP XML-RPC?

Thanks a lot for your help in advance.

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
echo '<h2>XML-RPC AVEC OPENERP/ODOO ET PHP</h2>';

include("xmlrpc_lib/xmlrpc.inc.php");
include("xmlrpc_lib/xmlrpcs.inc.php");
$GLOBALS['xmlrpc_internalencoding']='UTF-8';

$user = 'admin';
$password = 'mY5up3rPwd';
$dbname = 'test';

$server_url = 'http://192.168.1.120:8069'; 
$connexion = new xmlrpc_client($server_url . "/xmlrpc/common");
$connexion->setSSLVerifyPeer(0);

$c_msg = new xmlrpcmsg('login');
$c_msg->addParam(new xmlrpcval($dbname, "string"));
$c_msg->addParam(new xmlrpcval($user, "string"));
$c_msg->addParam(new xmlrpcval($password, "string"));
$c_response = $connexion->send($c_msg);

if ($c_response->errno != 0){
    echo  '<p>error : ' . $c_response->faultString() . '</p>';
}
else{
    
    $uid = $c_response->value()->scalarval();

    $val = array ( 
        "name"    => new xmlrpcval("Godin Thierry", "string"),
        "street"  => new xmlrpcval("Au fond à gauche", "string"),
        "city"    => new xmlrpcval("Marne la Vallée", "string"),
        "zip"     => new xmlrpcval("77000", "string"),
        "website" => new xmlrpcval("http://www.lapinmoutardepommedauphine.com", "string"),
        "lang"    => new xmlrpcval("fr_FR", "string"),
        "tz"      => new xmlrpcval("Europe/Paris", "string"),
        ); 
    
    $client = new xmlrpc_client($server_url . "/xmlrpc/object");
    $client->setSSLVerifyPeer(0);

    $msg = new xmlrpcmsg('execute'); 
    $msg->addParam(new xmlrpcval($dbname, "string")); 
    $msg->addParam(new xmlrpcval($uid, "int")); 
    $msg->addParam(new xmlrpcval($password, "string")); 
    $msg->addParam(new xmlrpcval("res.partner", "string")); 
    $msg->addParam(new xmlrpcval("create", "string")); 
    $msg->addParam(new xmlrpcval($val, "struct")); 
    $response = $client->send($msg);
    
    echo 'Partner created - partner_id = ' . $response->value()->scalarval();
}
?>

0
Avatar
Annuleer
Thierry Godin
Auteur

Hi Charles, You have to set the proper IP address of your own server, you have to set the proper dbname you use and your own credentials (username + password). Also, ensure you have copied the xmlrpc lib in the right path.

charles

Hi Thierry, Thank you very much for your reply. I'm sorry that I didn't make it clear. I did set the IP address, dbname, login and password correctly. For the xmlrpc lib, I copy it to a folder by following your comments in your tutorial. Please my code extract below. By the way, my odoo version is 8. Are there any settings in the odoo server side? echo '

XML-RPC AVEC OPENERP/ODOO ET PHP

'; include("xmlrpc/lib/xmlrpc.inc.php"); include("xmlrpc/lib/xmlrpcs.inc.php"); $GLOBALS['xmlrpc_internalencoding']='UTF-8'; $user = 'admin'; $password = 'password'; $dbname = 'mydb'; $server_url = 'http://192.168.56.101:8069';
charles

Hi Thierry, I've found a problem. In my version of xmlrpc, the file names of xmlrpc.inc and xmlrpcs.inc are without .php. In other words, the file names are xmlrpc.inc and xmlrpcs.inc only. In addition, there is typo in the program. It should be $c_response (not $response) of the following statement : echo 'Partner created - partner_id = ' . $response->value()->scalarval(); Although the program can be run successfully now, I can't find the record in odoo. Will check again tomorrow. Good night.

Thierry Godin
Auteur

Your 're right Charles, right typo is $c_response. Thanks for the info. About adding .php to .inc file is a security stuff to avoid diplaying inc file in browser.

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
Gerelateerde posts Antwoorden Weergaven Activiteit
How to use dynamic snippet for local Seo
web
Avatar
Avatar
2
jul. 25
2354
European Accessibility Act compliance
web
Avatar
1
mei 25
1748
How to import owl CharField?
web
Avatar
Avatar
2
mei 25
2383
Problems migrating from Odoo14 to Odoo17 due to web.assets_backend problem
web
Avatar
Avatar
1
jul. 24
4820
invalid website_form_signature
web
Avatar
0
aug. 24
341
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