Base Import Module

Cài đặt module Odoo từ file ZIP cho custom development và deployment

Base Import Module cho phép cài đặt module Odoo trực tiếp từ file ZIP thay vì Odoo App Store, hỗ trợ deploy custom module nội bộ, module từ bên thứ ba, hoặc module đang phát triển.

Module này hữu ích cho việc triển khai module riêng của công ty, test module trước khi publish, hoặc cài đặt module từ GitHub/GitLab mà không cần clone repository.

Module Import
ZIP Install
Custom Module
Deployment
Version Control

Tính năng chính

Điểm chính

  • • Import từ ZIP: Upload file .zip chứa module Odoo và cài đặt trực tiếp

  • • Dependency Resolution: Tự động kiểm tra và cảnh báo module phụ thuộc thiếu

  • • Version Check: Kiểm tra tương thích phiên bản Odoo trước khi cài đặt

  • • Manifest Validation: Xác thực __manifest__.py để đảm bảo cấu trúc đúng

  • • Multi-module ZIP: Hỗ trợ file ZIP chứa nhiều module cùng lúc

  • • Update Existing: Cập nhật module đã cài đặt bằng ZIP mới


Thuật ngữ EN/VI

FieldsTrường dữ liệuDescription
ModuleModuleGói mở rộng chức năng Odoo
ManifestManifestFile __manifest__.py chứa metadata module
DependencyPhụ thuộcModule khác cần thiết để module hoạt động
Addons PathĐường dẫn addonsThư mục chứa module Odoo
Technical NameTên kỹ thuậtTên thư mục module (snake_case)

Quy trình import module

Các bước thực hiện

  • 1. Chuẩn bị file ZIP: Đảm bảo cấu trúc đúng - thư mục module chứa __manifest__.py, __init__.py, và các file code. Ví dụ: my_module.zip chứa my_module/__manifest__.py.

  • 2. Vào Apps: Mở Apps menu, bật Developer Mode (Settings → Activate Developer Mode), nhấn nút "Import Module" ở góc trên.

  • 3. Upload ZIP: Chọn file ZIP từ máy tính, nhấn Import. Hệ thống sẽ extract và validate manifest.

  • 4. Kiểm tra dependencies: Nếu thiếu module phụ thuộc, cài đặt chúng trước hoặc bỏ qua cảnh báo (không khuyến khích).

  • 5. Install module: Sau khi import thành công, tìm module trong Apps list, nhấn Install.

  • 6. Update Apps List: Nếu không thấy module, nhấn "Update Apps List" để refresh danh sách.


Cấu trúc module chuẩn

File và thư mục bắt buộc

File/FolderBắt buộcMô tả
__manifest__.pyCóMetadata module: name, version, depends, data
__init__.pyCóImport các submodule Python
models/KhôngThư mục chứa model (Python class)
views/KhôngThư mục chứa XML view definition
security/KhôngFile ir.model.access.csv, record rules
data/KhôngXML data files (demo, default data)
static/KhôngJS, CSS, images cho frontend

Ví dụ thực tế

Use cases phổ biến

Tình huốngCách thực hiệnLợi ích
Deploy custom module nội bộDev team tạo module riêng, đóng gói ZIP, gửi cho admin import vào production. Không cần publish lên Odoo Store.Bảo mật code nội bộ, kiểm soát phiên bản, deploy nhanh
Test module từ GitHubDownload ZIP từ GitHub repository, import vào Odoo test instance. Test trước khi merge vào production.Test an toàn, không ảnh hưởng production
Cài module từ bên thứ baMua module từ vendor, nhận file ZIP, import vào Odoo. Không cần Odoo App Store.Hỗ trợ module không có trên Store
Update module hotfixDev sửa bug, tạo ZIP mới, admin import để update module đã cài. Không cần restart server.Hotfix nhanh, downtime tối thiểu

Troubleshooting

Điểm chính

  • • Error "Module not found": Check ZIP structure - module folder must be at ZIP root, not in subfolder

  • • Error "Invalid manifest": Check __manifest__.py syntax - must be valid Python dict with "name", "version", "depends" keys

  • • Error "Dependency not met": Install dependencies first, or remove from manifest (riskier)

  • • Module not in Apps: Click "Update Apps List", clear browser cache, or restart Odoo server

  • • Permission error: Ensure user has "Administration / Settings" rights to import modules