Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

Create openerp database with xmlrpc through php

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
databasephpxmlrpc
10 ตอบกลับ
10138 มุมมอง
อวตาร
ThackerS (ts)

Hi.
I want to create another database in openerp using php through xmlrpc.
Firstly, i located the database creation method on openerp: create_db in addons/base_quality_interrogation.py line 167.

And after that, i create my php code :

<?php
// import of xmlrpc library for php
include('xmlrpc.inc');

/* identifiants of the new database  */
$user = 'admin';
$password = 'my_db';
$dbname = 'my_db';
$lang="en_US";

    $server_url = 'http://localhost:8069'; //server url with security verification
    $client = new xmlrpc_client($server_url . "/xmlrpc/db");
    $client->setSSLVerifyPeer(0);

    $msg = new xmlrpcmsg('create_db'); // method create_db allow us to create a new database on openerp
    $msg->addParam(new xmlrpcval($dbname, "string"));
    $msg->addParam(new xmlrpcval($user,'string'));
    $msg->addParam(new xmlrpcval($password,'string'));
    $msg->addParam(new xmlrpcval($lang,'string'));
    $response = $client->send($msg);
    
    echo "<pre>";
    print_r($response);
    echo "</pre>";
?>


The running of the above php code produce the errors below :

xmlrpcresp Object (

[val] => 0

[valtyp] =>

[errno] => -1

[errstr] => Traceback (most recent call last):

File "C:\openerp\Server\server\.\openerp\service\wsgi_server.py", line 82, in xmlrpc_return

File "C:\openerp\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc

File "C:\openerp\Server\server\.\openerp\service\web_services.py", line 120, in dispatch

KeyError: 'Method not found: create_db'

[payload] =>

[hdrs] => Array

(

  [content-type] => text/xml

[content-length] => 628

[server] => Werkzeug/0.8.2 Python/2.6.5

[date] => Wed, 20 Aug 2014 07:02:08 GMT

)

[_cookies] => Array ( )

[content_type] => text/xml

[raw_data] => HTTP/1.0 200 OK

Content-Type: text/xml

Content-Length: 628

Server: Werkzeug/0.8.2 Python/2.6.5

Date: Wed, 20 Aug 2014 07:02:08 GMT

faultCode

Method not found: create_db

faultString

Traceback (most recent call last):

File "C:\openerp\Server\server\.\openerp\service\wsgi_server.py", line 82, in xmlrpc_return

File "C:\openerp\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc

File "C:\openerp\Server\server\.\openerp\service\web_services.py", line 120, in dispatch

KeyError: 'Method not found: create_db'

)

?>

I nedd a help. Thank you.

0
อวตาร
ละทิ้ง
อวตาร
Prakash
คำตอบที่ดีที่สุด

As Ben Bernard said web_service.py File find methods. exp_create_database Method is available.

so in xmlrpc through PHP You can create Database using the create_database Method.

0
อวตาร
ละทิ้ง
Ben Bernard

To clarify things. create_database is bocking version. create is non-blocking version. So if you want to wait until its execution finished, you need create_database. But if you don't want to wait, you can use create method. As a note, for some reason, create method is removed in Odoo 8.

อวตาร
Sonia
คำตอบที่ดีที่สุด

Can you please help me to create a database in odoo using php through xmlrpc

according to your experience.Please!!

0
อวตาร
ละทิ้ง
อวตาร
Ben Bernard
คำตอบที่ดีที่สุด

You can find available method and its definition in

openerp/service/web_services.py

In your case, check db class. Method definition prefixed with exp_.

So your method of interest is "create" and "exp_create".

0
อวตาร
ละทิ้ง
ThackerS (ts)
ผู้เขียน

Dear friends, i try the recommandation, but i still get error. Here is my php code : setSSLVerifyPeer(0); $msg = new xmlrpcmsg('create_database'); // method create_database allow us to create a new database on openerp $msg->addParam(new xmlrpcval($dbname, "string")); $msg->addParam(new xmlrpcval($user,'string')); $msg->addParam(new xmlrpcval($lang,'string')); $msg->addParam(new xmlrpcval($password,'string')); $response = $client->send($msg); echo "

";
	print_r($response);
	echo "
"; ?> Here is my error: xmlrpcresp Object ( [val] => 0 [valtyp] => [errno] => -1 [errstr] => Access denied. [payload] => [hdrs] => Array ( [content-type] => text/xml [content-length] => 286 [server] => Werkzeug/0.8.2 Python/2.6.5 [date] => Wed, 20 Aug 2014 08:29:42 GMT ) [_cookies] => Array ( ) [content_type] => text/xml [raw_data] => HTTP/1.0 200 OK Content-Type: text/xml Content-Length: 286 Server: Werkzeug/0.8.2 Python/2.6.5 Date: Wed, 20 Aug 2014 08:29:42 GMT faultCode AccessDenied faultString Access denied. ) ?>
ThackerS (ts)
ผู้เขียน

The previous comment is an error. I post my message in the top. Thank you.

อวตาร
ThackerS (ts)
ผู้เขียน คำตอบที่ดีที่สุด

Dear friends, i try the recommandation, but i still get error.

Here is my php code :

<?php
// import of xmlrpc library for php
include('xmlrpc.inc');

/* identifiants of the new database  */
$user = 'admin';
$password = 'my_db';
$dbname = 'my_db';
$lang="en_US";

    $server_url = 'http://localhost:8069'; //server url with security verification
    $client = new xmlrpc_client($server_url . "/xmlrpc/db");
    $client->setSSLVerifyPeer(0);
    
    $msg = new xmlrpcmsg('create_database'); // method create_database allow us to create a new database on openerp
    $msg->addParam(new xmlrpcval($dbname, "string"));
    $msg->addParam(new xmlrpcval($user,'string'));
    $msg->addParam(new xmlrpcval($lang,'string'));
    $msg->addParam(new xmlrpcval($password,'string'));
    $response = $client->send($msg);

    
    echo "<pre>";
    print_r($response);
    echo "</pre>";
?>

Here is my errors code :

xmlrpcresp Object ( [val] => 0 [valtyp] => [errno] => -1 [errstr] => Access denied. [payload] => [hdrs] => Array ( [content-type] => text/xml [content-length] => 286 [server] => Werkzeug/0.8.2 Python/2.6.5 [date] => Wed, 20 Aug 2014 08:29:42 GMT ) [_cookies] => Array ( ) [content_type] => text/xml [raw_data] => HTTP/1.0 200 OK Content-Type: text/xml Content-Length: 286 Server: Werkzeug/0.8.2 Python/2.6.5 Date: Wed, 20 Aug 2014 08:29:42 GMT faultCode AccessDenied faultString Access denied. )

Where i do errors ?

-1
อวตาร
ละทิ้ง
Ben Bernard

Add database master password as the first param.

Prakash

@Thacker Scott: For Access Denied Error. Using Pgadmin select Login Roles and select user right click Role privileges tab check all the check box and try to create DB using code.

ThackerS (ts)
ผู้เขียน

I succeeded. Thank you dear friends.

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
XMLRPC WITH PHP
php xmlrpc
อวตาร
0
มี.ค. 18
4969
Openerp xmlrpc PHP insert into re.users with company_id
php xmlrpc
อวตาร
อวตาร
2
มี.ค. 15
11340
How to identify record is created from xmlrpc script(php) when create method overrite
php xmlrpc
อวตาร
อวตาร
1
มี.ค. 15
8576
How to get the database list using XMLRPC webservice with Php ?
database postgresql php xmlrpc webservice
อวตาร
อวตาร
1
มี.ค. 15
8976
PHP Ripcord UnicodeEncodeError on Read
php xmlrpc utf8
อวตาร
อวตาร
1
ม.ค. 23
5774
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

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