Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Web Services Tutorial Odoo/PHP

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
webphpservices
2 Odpowiedzi
35466 Widoki
Awatar
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
Awatar
Odrzuć
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
Autor

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

Awatar
Thierry Godin
Autor Najlepsza odpowiedź

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
Awatar
Odrzuć
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 ...

Awatar
charles
Najlepsza odpowiedź

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
Awatar
Odrzuć
Thierry Godin
Autor

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
Autor

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.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
How to use dynamic snippet for local Seo
web
Awatar
Awatar
2
lip 25
2354
European Accessibility Act compliance
web
Awatar
1
maj 25
1748
How to import owl CharField?
web
Awatar
Awatar
2
maj 25
2383
Problems migrating from Odoo14 to Odoo17 due to web.assets_backend problem
web
Awatar
Awatar
1
lip 24
4820
invalid website_form_signature
web
Awatar
0
sie 24
341
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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