Skip to main content

Chuẩn bị môi trường để phát triển module Odoo

Các vấn đề khi thiết lập đó là bạn nên biết thực hiện các bước ở đâu, trên github, terminal, hay thư mục trên máy tính. Một khi xác định được đúng vị trí làm ở đâu bạn thao tác các bước một cách chính xác. 

I. Chuẩn Bị Trước Khi Bắt Đầu

  1. Đầu tiên bạn cần tạo một tài khoản Github account. Mình đã có tài khoản này rồi và sử dụng một thời gian khá lâu, chưa làm gì có điểm nhấn lắm. Mục đích quan trọng là để lưu trữ mã nguồn cho dự án của bạn
  2. Sau đó thêm ssh key https://github.com/settings/keys (bạn xem hướng dẫn tạo ssh key trên mac và trên window)
  3. Cài Odoo (có thể sử dụng trực tiếp file tải về) Tạo thư mục ví dụ ERP sau đó 

    Đây là đường dẫn vào /Users/tinhle/ERP

$ git clone [email protected]:odoo/odoo.git
$ git clone [email protected]:odoo/enterprise.git
$ git clone [email protected]:odoo/tutorials.git

Lưu ý để chạy liên tục, tránh tắt màn hình, quá trình tải về sẽ bị gián đoạn.

  1. Tạo git fork bạn tạo 3 phiên bản, một phiên bản fork của community, một của enterprise và một của tutorials

https://github.com/vntechsolutions/odoo

https://github.com/vntechsolutions/tutorials

Mình không có key vào enterprise nên không fork cái này ra. Thực ra bản này là được xây trên bản community với các add-ons và mô đun. 

  1. Link git with fork (tạo liên kết git ở trên máy tính với bản fork trên github)

Lệnh dưới đây dùng để kết nối git với rep fork trên github.

$ cd /CommunityPath   (/Users/tinhle/ERP/odoo)
$ git remote add dev [email protected]:<vntechsolutions>/odoo.git

Cụ thể cd ERP/tutorials

$ git remote add dev [email protected]:vntechsolutions/tutorials.git

If you have access to odoo/enterprise, configure the related remote too.

Sửa git global config do lỗi dưới đây. Để sử file này thì sử dụng vi editor

error: key does not contain a section: clean
error: key does not contain a section: smudge
error: key does not contain a section: process
error: key does not contain a section: required

[core]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process
        required = true
        autocrlf = false
[user]
        name = Tinh Le
        email = [email protected]

$ cd /EnterprisePath

 

$ git remote add dev [email protected]:<your_github_account>/enterprise.git