Trang

Monday, June 22, 2015

Bài 1: Cài đặt OpenERP

Hiện nay Openerp ( Odoo) đã phát hành bản V8 có nhiều tính năng mới hơn so với bản V7, các bạn có thể cài đặt và khám phá các tính năng mới này nhé.
cài đặt openerp

Để cài đặt OpenERP 8.0 trên Windows các bạn làm theo hướng dẫn sau đây:

B1 : Đầu tiên các bạn phải download gói cài OpenERP V8 tại đây để dowload bản odoo_8.0-latest.exe

B2 : Thực hiện cài đặt
 > Chọn "OpenERP Server" để cài server và chọn "PostgresSQL Database" để cài database PostgresSQL sử dụng cho OpenERP
Trong đó:
- Hostname : localhost
- Port : 5432 (cổng kết nối với PostgreSQL)
- Username : openerp (user đăng nhập trong PostgresSQL)
- Password : openpgpwd (password đăng nhập trong PostgresSQL)

> Xác định thư mục cài OpenERP V8.0

> Sau khi hoàn tất , các bạn vào trình duyệt gõ "localhost:8069

B3 : Cài đặt database sử dụng
Các bạn ấn vào nút "Manage Database" để tạo database nhé

Master password : Mật khẩu quản trị
New database name : Tên database
Load database name : Lấy dữ liệu mẫu hay không
Degault language : Ngôn ngữ sử dụng
Admin password : Mật khẩu admin
Confirm password : Xác nhận lại mật khẩu admin
 Bản v8 cài tương tự như bản V7. Các bạn có thể tham khảo gói cài V7 trong video hướng dẫn openerp trại trang openerp4vn.
Chúc các bạn cài server OpenERP thành công!
*****************************************************************************************************
 Bài viết này mình sẽ hướng dẫn mọi người các cài đặt OpenERP V7 và tạo database trên Windows
[IMG]
[IMG]
[IMG]
Tại đây , mình chọn "OpenERP Server" để cài server và chọn "PostgresSQL Database" để cài database PostgresSQL sử dụng cho OpenERP
[IMG]
Hostname : localhost
Port : 5432 (cổng kết nối với PostgreSQL)
Username : openerp (user đăng nhập trong PostgresSQL)
Password : openpgpwd (password đăng nhập trong PostgresSQL)
[IMG]
Xác định thư mục cài OpenERP V7.0


Sau khi hoàn tất , các bạn vào trình duyệt gõ "localhost:8069" hoặc địa chỉ máy server +" : 8069" ( :8069 là cổng kết nối với server OpenERP)
  • B3 : Cài đặt database sử dụng
Các bạn ấn vào nút "Manage Database" để tạo database nhé
[IMG]
[IMG]
Master password : Mật khẩu quản trị
New database name : Tên database
Load database name : Lấy dữ liệu mẫu hay không
Degault language : Ngôn ngữ sử dụng
Admin password : Mật khẩu admin
Confirm password : Xác nhận lại mật khẩu admin
[IMG]


Chúc các bạn cài server OpenERP thành công

**********************************************************************************

LỜI MỞ ĐẦU: OpenERP là một phần mềm quản lý doanh nghiệp hiện đại, phát hành theo giấy phép AGPL, và có đầy đủ các tính năng CRM, Nhân Sự, Bán Hàng, Kế Toán, Sản Xuất, Quản Lý Kho, Quản Lý Dự Án, ... Nó được phát triển dựa trên framework OpenObject, một framework hướng mô đun, có khả năng mở rộng, và là một nền tảng trực quan được viết bằng ngôn ngữ Python để giúp phát triển các ứng dụng một cách nhanh chóng.
OpenObject có một bộ công cụ đầy đủ và hướng mô đun để xây dựng các ứng dụng nhanh chóng: hỗ trợ Object-Relationship Mapping (ORM), mô hình Model-View-Controller (MVC), một hệ thống xuất báo cáo, đa ngôn ngữ, và nhiều thứ khác nữa.
Python là một ngôn ngữ lập trình bậc cao, lý tưởng cho RAD (Rapid Application Development), kết hợp sức mạnh với cú pháp rõ ràng, và được thiết kế tối ưu giúp giữ cho phần lõi luôn nhỏ gọn.
Mẹo: Một số liên kết hữu ích:
• Trang chủ và download : thuộc vào cấu hình của bạn.
Phần mềm máy khách (Client software)
OpenERP cung cấp một phần mềm máy khách (gọi là GTK Client) trên tất cả các nền tảng, và một giao diện web có thể truy cập bằng bất kỳ trình duyệt hiện đại nào.

Mẹo: Quá trình cài đặt
Hãy luôn kiểm tra các tài liệu hướng dẫn (trong bản phân phối hoặc trên website) để cập nhật thông tin mới nhất về bản cài đặt; vì bản cài đặt luôn được phát triển và phụ thuộc vào nhiều phần mềm khác. Xem tạihttp://doc.openerp.com/install.
Gói cài đặt
  • Windows: trên website chúng tôi có sẵn các bản cài đặt all-in-one, hoặc các bản cài đặt riêng lẻ dành cho: server, client, webserver.
  • Linux: bạn có thể cài các gói OpenERP-server và OpenERP-client bằng cách trình quản lý gói cài đặt như Synaptic của Ubuntu.
  • Mac: ở trang devteam.taktik.be có các gói cài đặt GTK Client, cũng như các bài hướng dẫn để cài openerp-server.
Cài đặt từ mã nguồn
Có 2 cách: tải gói mã nguồn ngay trên website của OpenERP hoặc dùng Bazaar (phần mềm quản lý phiên bản mã nguồn phân tán) để tải trực tiếp từ Launchpad. Bạn cũng cần phải cài đặt các chương trình phụ thuộc khác (như PostgreSQL và một vài thư viện Python – xem tài liệu tại doc.openerp.com)
Gợi ý biên dịch: Vì OpenERP được viết bằng Python, nên bạn không cần phải biên dịch trước khi chạy.
Các bước tải mã nguồn bằng bazaar(các bản Linux trên nền Debian):
Mã (text):
  1. $ sudo apt-get install bzr # cài đặt phiên bản bazaar
  2. $ bzr branch lp:openerp # gọi trình cài đặt nguồn
  3. $ cd openerp && python ./bzr_set.py # nạp mã và cài đặt
Khởi tạo Database
Sau khi cài đặt, chạy các chương trình máy chủ và máy khách. Từ phần mềm GTK Client, vào File→Databases→New Database để tạo ra một cơ sở dữ liệu mới (mật khẩu mặc định của quản trị viên là admin). Mỗi csdl đều có các mô đun và cấu hình riêng của nó, và bạn cũng có thể chọn dữ liệu demo trong lúc tạo csdl.

**********************************************************************************
Dù bạn là một nhân viên công ty nhỏ đang tìm hiểu cách hoạt động của Open ERP, hay là một chuyên viên CNTTcủa một tổ chức lớn được giao nhiệm vụ đánh giá khả năng của Open ERP, việc đầu tiên bạn cần làm là cài đặt nó.
Bảng đưới đây tóm tắt các phương pháp cài đặt sẽ được lần lượt trình bày trong phần này.
Comparison of the different methods of installation on Windows or Linux
Phương pháp
Thời gian trung bình
Độ phức tạp
Ghi chú
Gói cài đặt All-in-one Windows
vài phút
đơn giản
Rất tiện cho việc đánh giá nhanh vì nó sẽ cài đặt tất cả các thành phần đã được cấu hình sẵn trên một mát (dùng GTK client).
Cài từng bản độc lập trên Windows
nửa tiếng
trung bình
Cho phép bạn cài đặt từng thành phần trên cách máy vi tính khác nhau. Có thể dùng trong để triển khai thực tế.
Gói cài đặt Ubuntu Linux
vài phút
đơn giản
Nhanh gọn, nhưng gói cài đặt thường không được cập nhật phiên bản mới nhất.
Build từ mã nguồn, trên mọi hệ Linux
hơn nửa tiếng
hơi khó
Bạn nên dùng cách này khi triển khai thực tế vì hệ thống được cập nhật mới nhất.
Mỗi khi một phiên bản mới của Open ERP được phát hành, Tiny sẽ cung cấp gói cài đặt tự động bản đầy đủ tương ứng trên Windows, bao gồm PostgreSQL database Server, Open ERP và GTK client,
Gói cài đặt tự động này cho phép bạn cài đặt toàn bộ hệ thống chỉ bằng cài cú nhấp chuột. Những cấu hình ban đầu sẽ được thiết lập trong quá trình cài đặt, giúp bạn bắt đầu dùng nó 1 cách nhanh chóng, nếu bạn không muốn thay đổi các thuật toán bên trong. Nó được thiết kế để chạy trên 1 PC đơn, nhưng bạn vẫn có thể kết nối GTK client từ 1 PC, Mac hay Linux khác.
Việc đầu tiên là tải gói cài đặt Open ERP về. Lúc này bạn sẽ chọn phiên bản nào để cài, bản ổn định hay bản đang phát triển. Nếu mục tiêu của bạn là triển khai thực tế, ban nên chọn bạn ổn định.
Ghi chú
Bản ổn định và bản đang phát triển
Open ERP được phát triển song song 2 dòng: các phiên bản ổn định và các phiên bản đang phát triển.
Các tính năng mới được tích hợp vào dòng đang phát triển. Dòng này cao cấp hơn dòng ổn định, nhưng nó có thể chứa các lỗi chưa được phát hiện hay chưa được sửa chữa Các bản phát triển sẽ được phát hành hàng tháng, và Tiny có các repository để bạn có thể tải về phiên bản mới nhất
Dòng ổn định được thiết kế cho các dự án triển khai thực tế. Những tính năng mới chỉ được phát hành khoảng 1 lần/năm. Chỉ có những cập nhật sử lỗi được phát hành thường xuyên ở dòng ổn định này.

Để tải Open ERP bản dành cho Windows, bạn làm như sau:
  1. Vào trang http://openerp.com.
  2. Nhấp Downloads ở cột bện trái, phía dưới Windows Installers, All in One.
  3. Bạn sẽ tải về phiên bản mới nhất, hiện là openerp-allinone-setup-5.0.0-3.
  4. Save file này trên PC. Kích thước nó khá lớn, vì nó gồm luôn cả PostgreSQL database system.

Để cài đặt Open ERP, bạn cần đăng nhập bằng tài khoản Administrator. Nhấp chuột đôi vào gói cài đặt và chấp nhận các giá trị mặc định trong các bước.
If you had previously tried to install the all-in-one version of Open ERP, you have to uninstall that first because various elements of a previous installation could interfere with your new installation. Make sure that all Tiny ERP, OpenERP and PostgreSQL applications are removed: you're likely to have to restart your PC to finish removing all traces of them.
Bạn có thể chạy ứng dụng Open ERP để dùng hệ thống Open ERP system sau khi hoàn trình quá trình cài đặt này. Bước tiếp theo là thiết lập cơ sở dữ liệu, sẽ được trình bày trong mục cuối chương này Creating the database.

Cài từng bản độc lập trên Windows

Các quản trị viên hệ thống thường muốn cài từng thành phần riêng của hệ thống trên Windows. Ví dụ, công ty của bạn có thể không hỗ trợ phiên bản PostgreSQL hay Python đi kèm với gói all-in-one, hoặc có thể bạn đã cài và sử dụng PostgreSQL trên máy, hoặc bạn muốn cài các thành phần trên các máy chủ khác nhau.
Trong trường hợp này, bạn có thể tải các gói cài độc lập ở cùng chỗ với gói all-in-one. Bạn cũng cần tự tải về và cài đặt PostgreSQL.
Bạn cần cài đặt PostgreSQL trước Open ERP server, và bạn phải thiết lập username và password để Open ERP server có thể truy cập được. Tài liệu trực tuyến của Tiny có hướng dẫn cụ thể hơn về vấn đề này.

Kết nối từ PC khác đến máy chủ ERP

Để kết nối từ PC khác đến máy chủ Open ERP, bạn cần thiết lập để server trực tuyến có thể truy cập được, và phải cài GTK client trên tất cả các máy khách:
  1. Để thiết lập máy chủ Open ERP có thể truy cập được từ các máy khác, bạn mở Windows Firewall trong Control Panel rồi yêu cầu firewall tạo exception cho Open ERP server. Trong tab Exceptionscủa Windows Firewall, bạn nhấp vào Add a program... and choose và chọn Open ERP Server trong danh sách. Bước này giúp các máy khác truy cập được đến máy chủ Open ERP.
  2. Cài đặt Open ERP client (openerp-client-5.X.exe), có được tải về cùng chỗ với các gói cài đặt Open ERP khác lên các PC còn lại.
Mẹo
Vấn đề tương thích giữa các phiên bản
Bên cần chắc chắn rằng các phần mềm cài đặt trên máy chủ và máy khách có cùng phiên bản. Số phiên bản là một phần trong tên của các file được tải xuống. Mặc dù một số phiên bản có thể tương thích với nhau, nhưng điều đó là không chắc chắn.

Để cài đặt Open ERP Client trên các PC khác, bạn cũng cần đăng nhập bằng tài khoản quản trị. Việc cài đặt được tự đống hoá, nên bạn chỉ cần chỉnh vài thứ trong suốt quá trình.
Để chạy thử, bạn hãy mở Open ERP Client và kết nối đến máy chủ Open ERP khi còn đang dùng tài khoản quản trị.
Ghi chú
Tại sao cần phải đăng nhập bằng tài khoản quản trị?
Bạn không cần dùng tài khoản quản trị để chạy Open ERP client, nhưng nếu có vấn rắc rối xảy ra, bạn sẽ không phải đăng nhập lại tài khoản quản trị để có những sửa chữa và thiết lập cần thiết.
Start the GTK client on the server through the Windows Start menu there. The main client window appears, identifying the server you're connected to (which is localhost – your own server PC – by default). If the message No database found, you must create one appears then you've successfully connected to an Open ERP server containing, as yet, no databases.
/doc_static/5.0/_images/new_login_dlg.png
Hộp thoại xuất hiện khi GTK client kết nối thành công đến Open ERP server
Ghi chú
Connection modes
In its default configuration at the time of writing, the Open ERP client connects to port 8069 on the server using the XML-RPC protocol (from Linux) or port 8070 using the NET-RPC protocol instead (from Windows). You can use either protocol from either operating system. NET-RPC is quite a bit quicker, although you may not notice that on the GTK client in normal use. OpenERP can run XML-RPC, but not NET-RPC, as a secure connection.

Resolving errors with a Windows installation

If you can't get OpenERP to work after installing your Windows system you'll find some ideas for resolving this below:
  1. Open ERP Server có đang chạy không? Đăng nhập vào máy chủ bằng tài khoản quản trị, tắt và khởi động lại service bằng Stop Service  Start Service từ trình đơn Start ‣ Programs ‣ OpenERP Server .
  2. Is the Open ERP Server set up correctly? Signed in to the server as Administrator, open the fileopenerp-server.conf in C:\Program Files\OpenERP AllInOne and check its content. This file is generated during installation with information derived from the database. If you see something strange it's best to entirely reinstall the server from the demonstration installer rather than try to work out what's happening.
    /doc_static/5.0/_images/terp_server_conf.png
    Typical OpenERP configuration file
  3. Is your PostgreSQL running? Signed in as administrator, select Stop Service from the menu Start ‣ Programs ‣ PostgreSQL. If, after a couple of seconds, you can read The PostgreSQL4OpenERP service has stopped then you can be reasonably sure that the database server was working. Restart PostgreSQL.
  4. Is the database accessible? Still in the PostgreSQL menu, start the pgAdmin III application which you can use to explore the database. Double-click on the PostgreSQL4OpenERP connection. You can find the password in the OpenERP server configuration file. If the database server is accessible you'll be able to see some information about the empty database. If it's not then an error message will appear.
  5. Open ERP Client có hoạt động không? Nếu không thì bạn nên cài đặt lại nó.
  6. Can remote client computers see the server computer at all? Check this by opening a command prompt window (enter cmd in the window Start ‣ Run... ) and enter ping <address of server>there (where <address of server> represents the IP address of the server). The server should respond with a reply.
  7. Bạn có thay đổi tham số nào của máy chủ không? Vào thời điểm này, cổng kết nối phải được đặt số 8069 dùng giao thức XML-RPC.
  8. Is there anything else in the server's history that can help you identify the problem? Open the fileopenerp-server.log in C:\Program Files\OpenERP AllInOne(which you can only do when the server is stopped) and scan through the history for ideas. If something looks strange there, contributors to the Open ERP forums can often help identify the reason.

Cài đặt trên Linux (Ubuntu)

Mục này sẽ hướng dẫn bạn cài đặt Open ERP Server và Client trên Ubuntu 1 trong những dòng phổ biến nhất của Linux. Hướng dẫn dựa trên bản Desktop phát hành gần đây của Ubuntu có GUI (Graphical User Interface: giao diện đồ hoạ cho người dùng).
Ghi chú
Những dòng Linux khác
Cài đặt trên các dòng Linux khác cũng khá giống với trên Ubuntu. Sau khi đọc phần này và có những hiểu biết cơ bản, bạn hãy sử dụng các tài liệu và diễn đàn trực tuyến để tìm hiểu thêm.
Để tìm hiểu thêm thông tin về các dòng Linux khác, bạn có thể vào phần tài liệu trênhttp://www.openerp.com trong Product ‣ Documentation . Trên đó có các hướng dẫn chi tiết cho từng dòng và từng phiên bản Linux. Bạn cũng nên kiểm tra xem có huống dẫn nào mới cho Ubuntu hay không.

Technical procedure: Initial installation and configuration

Upgrade of Ubuntu packages and installation of openerp and pgadmin:
$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install openerp-server openerp-client pgadmin3
To avoid having some of the labels untranslated in the GTK client, install the language-pack-gnome-YOURLANG-base package. The following command installs the spanish language pack:
$ sudo apt-get install language-pack-gnome-es-base
Postgres Database configuration:
$ sudo vi /etc/postgresql/8.3/main/pg_hba.conf
Replace the following line:
# “local” is for Unix domain socket connections only
local all all ident sameuser
with:
#”local” is for Unix domain socket connections only
local all all md5
Restart Postgres:
$ sudo /etc/init.d/postgresql-8.3 restart

* Restarting PostgreSQL 8.3 database server [ OK ]
The following two commands will avoid problems with /etc/init.d/openerp-web INIT script:
$ sudo mkdir /home/openerp

$ sudo chown openerp.nogroup /home/openerp
Create a user account called openerp with password “openerp” and with privileges to create Postgres databases:
$ sudo su postgres

$ createuser openerp -P

Enter password for new role: (openerp)

Enter it again:

Shall the new role be a superuser? (y/n) n

Shall the new role be allowed to create databases? (y/n) y

Shall the new role be allowed to create more new roles? (y/n) n
Quit from user postgres:
$ exit

exit
Edit OpenERP configuration file:
$ sudo vi /etc/openerp-server.conf
Replace the following two lines (we don’t force to use a specific database and we add the required password to gain access to postgres):
db_name =

db_user = openerp

db_password = openerp
Troubles with Python releases: Python 2.6 is not yet supported by OpenERP 5.0, but it is the default Python release on Ubuntu 9.0.4. We need to launch OpenERP 5.0 with Python 2.5 or earlier. There’s also a problem with python-xml package in Ubuntu so we will reinstall it.
Python 2.5 setting up:
$ sudo apt-get install python2.5 python2.5-dev python-profiler
Reinstall python-xml:
$ wget http://freefr.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.4.tar.gz

$ tar xvzf PyXML-0.8.4.tar.gz

$ cd PyXML-0.8.4/

$ sudo python2.5 setup.py install
Make the following symbolic link:
$ sudo ln -s /usr/lib/python2.6/dist-packages/oldxml/_xmlplus/utils/boolean.so /usr/lib/python2.5/site-packages/oldxml/_xmlplus/utils/
Force openerp-server to be launched with Python2.5:
$ cd /usr/bin/

$ sudo cp openerp-server openerp-server.ORIG

$ sudo vi openerp-server
Replace the following line:
exec /usr/bin/python ./openerp-server.py $@
with
exec /usr/bin/python2.5 ./openerp-server.py $@
We can now restart openerp-server:
$ sudo /etc/init.d/openerp-server restart

Restarting openerp-server: openerp-server.
Check out the logs:
$ sudo cat /var/log/openerp.log

[2009-06-14 21:06:39,314] INFO:server:version – 5.0.0

[2009-06-14 21:06:39,314] INFO:server:addons_path – /usr/lib/openerp-server/addons

[2009-06-14 21:06:39,314] INFO:server:database hostname – localhost

[2009-06-14 21:06:39,315] INFO:server:database port – 5432

[2009-06-14 21:06:39,315] INFO:server:database user – openerp

[2009-06-14 21:06:39,315] INFO:objects:initialising distributed objects services

[2009-06-14 21:06:39,502] INFO:web-services:starting XML-RPC services, port 8069

[2009-06-14 21:06:39,502] INFO:web-services:starting NET-RPC service, port 8070

[2009-06-14 21:06:39,502] INFO:web-services:the server is running, waiting for connections…
OpenERP is now up and running, connected to Postgres database on port 5432 and listening on ports 8069 and 8070
$ ps uaxww | grep -i openerp

root   2276  0.0  2.3 185576 23708 ?        Sl   13:09   0:00 /usr/bin/python2.5 ./openerp-server.py –config=/etc/openerp-server.conf
$ sudo lsof -i :8069

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

python2.5 2276 openerp 3u IPv4 6515 TCP localhost:8069 (LISTEN)
$ sudo lsof -i :8070

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

python2.5 2276 openerp 5u IPv4 6520 TCP *:8070 (LISTEN)
Start the OpenERP GTK client by clicking its icon in the Applications menu, or by opening a terminal window and typing tinyerp-client . The OpenERP login dialog box should open and show the message No database found you must create one!.
Although this installation method is simple and therefore an attractive option, it's better to install Open ERP using a version downloaded from http://openerp.com. The downloaded revision is likely to be far more up to date than that available from a Linux distribution.
Ghi chú
Package versions
Maintaining packages is a process of development, testing and publication that takes time. The releases in Open ERP (or Tiny ERP) packages are therefore not always the latest available. Check the version number from the information on the website before installing a package. If only the third digit group differs (for example 5.0.1 instead of 5.0.2) then you may decide to install it because the differences may be minor – fault fixes rather than functionality changes between the package and the latest version.

Manual installation of the Open ERP server

Mục này sẽ giúp bạn build Open ERP từ mã nguồn từ http://openerp.com, và cài đặt các thư viện và phần mềm khác mà Open ERP cần để hoạt động trên phiên bản Desktop của Ubuntu. Quá trình được tóm tắt như sau:
  1. Dùng trình duyệt vào trang http://openerp.com
  2. Nhấp chuột vào Downloads ở cột trái,
  3. Tải mã nguồn của Server và Client từ mục Sources (Linux) xuống thư mục home của bạn (hoặc thư mục khác nếu bạn có thiết lập trước).
Để cài PostgreSQL và các phần mềm phục thuộc cho Open ERP bằng Synaptic Package Manager:
  1. Chạy Synaptic Package Manager, nhập root password khi được yêu cầu.
  2. Check that the repositories main universe and restricted are enabled.
  3. Search for a recent version of PostgreSQL (such as postgresql-8.3 then select it for installation along with its dependencies.
  4. Select all of OpenERP's dependences, an up-to-date list of which should be found in the installation documents on Tiny's website, then click Update Now to install them.
Ghi chú
Python programming language
Python is the programming language that's been used to develop Open ERP. It's a dynamic, non-typed language that is object-oriented, procedural and functional. It comes with numerous libraries that provide interfaces to other languages and has the great advantage that it can be learnt in only a few days. It's the language of choice for large parts of NASA's, Google's and many other enterprises' code.
For more information on Python, explore http://www.python.org.
Once all these dependencies and the database are installed, install the server itself using the instructions on the website.
Open a terminal window to start the server with the command sudo -i -u postgres openerp-server , which should result in a series of log messages as the server starts up. If the server is correctly installed, the message [...] waiting for connections... should show within 30 seconds or so, which indicates that the server is waiting for a client to connect to it.
/doc_static/5.0/_images/terps_startup_log.png
OpenERP startup log in the console

Manual installation of Open ERP GTK clients

To install an Open ERP GTK client, follow the steps outline on the website installation document for your particular operating system.
Mẹo
Survey: Don't Cancel!
When you start the GTK client for the first time, a dialog box appears asking for various details that are intended to help the Tiny company assess the prospective user base for its software.
If you click the Cancel button, the window goes away – but Open ERP will ask the same questions again next time you start the client. It's best to click OK, even if you choose to enter no data, to prevent that window reappearing next time.
/doc_static/5.0/_images/terp_client_startup.png
OpenERP client at startup
Open a terminal window to start the client using the command openerp-client. When you start the client on the same Linux PC as the server you'll find that the default connection parameters will just work without needing any change. The message No database found, you must create one! shows you that the connection to the server has been successful and you need to create a database on the server.

Creating the database

You can connect other GTK clients over the network to your Linux server. Before you leave your server, make sure you know its network address – either by its name (such as mycomputer.mycompany.net ) or its IP address (such as 192.168.0.123 ).
Ghi chú
Different networks
Communications between an Open ERP client and server are based on standard protocols. You can connect Windows clients to a Linux server, or vice versa, without problems. It's the same for Mac versions of Open ERP – you can connect Windows and Linux clients and servers to them.
To install an Open ERP client on a computer under Linux, repeat the procedure shown earlier in this section. You can connect different clients to the Open ERP server by modifying the connection parameters on each client. To do that, click the Change button on the connection dialog and set the following field as needed:
  • Server : name or IP address of the server over the network,
  • Port : the port, whose default is 8069 or 8070,
  • Connection protocol : XML-RPC or NET-RPC .
/doc_static/5.0/_images/terp_client_server.png
Dialog box for defining connection parameters to the server
It's possible to connect the server to the client using a secure protocol to prevent other network users from listening in, but the installation described here is for direct unencrypted connection.
If your Linux server is protected by a firewall you'll have to provide access to port
8069or 8070for users on other computers with Open ERP GTK clients.

Installation of an OpenERP web server

Just as you installed a GTK client on a Linux server, you can also install the OpenERP client-web server. You can install it from sources after installing its dependencies from packages as you did with the Open ERP server, but Tiny have provided a simpler way to do this for eTiny – using a system known as ez_setup.
Before proceeding, confirm that your Open ERP installation is functioning correctly with a GTK client. If it's not you'll need to go back now and fix it, because you need to be able to use it fully for the next stages.
To install client-web follow the up-to-date instructions in the installation document on the website.
Ghi chú
Ez tool
Ez is the packaging system used by Python. It enables the installation of programs as required just like the packages used by a Linux distribution. The software is downloaded across the network and installed on your computer by ez_install.
ez_setup is a small program that installs ez_install automatically.
The OpenERP Web server connects to the Open ERP server in the same way as an Open ERP client using the NET-RPC protocol. Its default setup corresponds to that of the Open ERP server you've just installed, so should connect directly at startup.
  1. At the same console as you've just been using, go to the Openerp web directory by typing cd openerp-web-5.X.
  2. At a terminal window type start-openerp-web to start the OpenERP Web server.
/doc_static/5.0/_images/web_welcome.png
OpenERP web client at startup
You can verify the installation by opening a web browser on the server and navigating tohttp://localhost:8080 to connect to eTiny as shown in the figure OpenERP web client at startup. You can also test this from another computer connected to the same network if you know the name or IP address of the server over the network – your browser should be set to http://<server_address>:8080 for this.

Verifying your Linux installation


You've used default parameters so far during the installation of the various components. If you've had problems, or you just want to set this up differently, the following points provide some indicators about how you can set your installation up.
Mẹo
psql and pgAdmin tools
psql is a simple client, executed from the command line, that's delivered with PostgreSQL. It enables you to execute SQL commands on your Open ERP database.
If you prefer a graphical utility to manipulate your database directly you can install pgAdmin III (it is commonly installed automatically with PostgreSQL on a windowing system, but can also be found athttp://www.pgadmin.org/ ).
  1. The PostgreSQL database starts automatically and listens locally on port 5432 as standard: check this by entering sudo netstat -anpt at a terminal to see if port 5432 is visible there.
  2. The database system has a default role of postgres accessible by running under the Linux postgres user: check this by entering sudo su postgres -c psql at a terminal to see the psql startup message – then type \q to quit the program.
  3. Start the Open ERP server from the postgres user (which enables it to access the PostgreSQL database) by typing sudo su postgres -c tinyerp-server.
  4. If you try to start the Open ERP server from a terminal but get the message socket.error: (98,'Address already in use') then you might be trying to start Open ERP while an instance of Open ERP is already running and using the sockets that you've defined (by default 8069 and 8070). If that's a surprise to you then you may be coming up against a previous installation of Open ERP or Tiny ERP, or something else using one or both of those ports.
    Type sudo netstat -anpt to discover what is running there, and record the PID. You can check that the PID orresponds to a program you can dispense with by typing ps aux | grep <PID>and you can then stop the program from running by typing sudo kill <PID>. You need additional measures to stop it from restarting when you restart the server.
  5. The Open ERP server has a large number of configuration options. You can see what they are by starting the server with the argument –help By efault the server configuration is stored in the file.terp_serverrc in the user's home directory (and for the postgres user that directory is/var/lib/postgresql .
  6. You can delete the configuration file to be quite sure that the Open ERP server is starting with just the default options. It is quite common for an upgraded system to behave badly because a new version server cannot work with options from a previous version. When the server starts without a configuration file it will write a new one once there is something non-default to write to it – it will operate using defaults until then.
  7. To verify that the system works, without becoming entangled in firewall problems, you can start the Open ERP client from a second terminal window on the server computer (which doesn't pass through the firewall). Connect using the XML-RPC protocol on port 8069 or NET-RPC on port 8070. The server can use both ports simultaneously. The window displays the log file when the client is started this way.
  8. The client setup is stored in the file .terprc in the user's home directory. Since a GTK client can be started by any user, each user would have their setup defined in a configuration file in their own home directory.
  9. You can delete the configuration file to be quite sure that the Open ERP client is starting with just the default options. When the client starts without a configuration file it will write a new one for itself.
  10. The web server uses the NET-RPC protocol. If a GTK client works but the web server doesn't then the problem is either with the NET-RPC port or with the web server itself, and not with the Open ERP server.
Gợi ý
One server for several companies
You can start several Open ERP application servers on one physical computer server by using different ports. If you have defined multiple database roles in PostgreSQL, each connected through an Open ERP instance to a different port, you can simultaneously serve many companies from one physical server at one time.

***********************************************************************************
  1. Chào bạn,
    Bạn có thể thực hiện việc đó bằng cách:
    • Vào menu Settings - Configuration - General Settings
    • Chọn vào tính năng Allow external users to sign up
    • Chọn user được phân quyền tương ứng mà người đăng kí có thể sử dụng khi đăng nhập vào hệ thống.
    • Chọn Use external authentication providers, sign in with google, facebook, ... nếu bạn cho phép đăng kí từ tài khoản Google, Facebook, ...
    • Và sau cùng là nhấn vào Apply để hoàn tất.
    [IMG]
    Thân.
  2. openerpvietnamActive Member

    Chào bạn,
    Bạn không thấy menu Technical là do user bạn đang dùng chưa được phân quyền Technical đó bạn.
    Bạn hãy vào user mình đang đăng nhập (Settings - Users - Users), vào Tab Access Rights và check chọn thêm quyền Technical Features
    Save lại và tiến hành refresh lại Web Client là sẽ thấy thôi bạn.
    [IMG]
    Thân.

2 comments:

  1. Chỉ cần cài 1 máy là server, các máy khác là client.
    Nếu bạn muốn các máy trong mạng nội bộ nối tới máy cài server chỉ cần gõ địa chỉ ip
    cách 1: http://192.168.x.y:8069 Trong đó : 192.168.x.y là địa chỉ ip của máy server trong mạng nội bộ
    cách 2: hoặc tên máy vào dòng địa chỉ http://tenmayserver:8069
    Nếu không nối được thì bạn phải vào máy chủ( server) mở cổng 8069 như ở #mce_temp_url# với tường lửa của windows Xp( các loại tường lửa khác thì cách làm cũng gần tương tự) .

    Muốn biết tên của máy server , ở máy server kich chuot phai vao mycomputer, chọn Propertites , tên máy ở dòng computer name.

    Muốn biết địa chỉ ip trong mạng nội bộ của máy server Bấm chọn start\ run đánh cmd ấn enter. gõ ipconfig rồi enter sẽ thấy dòng ipv4 addresss . thông thường 192.168.1.xx

    Nếu máy không cùng trong mạng nội bộ, bạn phải thiết lập một kênh riêng tới máy server( VPN),việc này phức tạp hơn chút( bạn phải khai báo cho mô đêm chuyển tiếp tới máy server), khi kết nối được thì rồi làm tương tự máy nội bộ

    ReplyDelete
  2. - Problem 3: Các máy khác nếu muốn access vào erp trên máy em thì e cho họ ip máy em kèm theo port 8069 nhé . Ví dụ [ip máy] : 8069
    * Còn nếu e có ý đinh triển khai lên server thì là chuyện khác nhé, ở đây mình chỉ public hệ thống để các bạn dễ tiếp cận thôi

    ReplyDelete