addon_metadata:
  name: "[snake_case_addon_name]"
  display_name: "[Tên hiển thị thân thiện]"
  version: "[17.0.1.0.0]"
  category: "[Danh mục - ví dụ Sales, Inventory, Accounting, Operations]"
  summary: "[Mô tả ngắn gọn một dòng]"
  author: "[Your Company], Odoo Community Association (OCA)"
  website: "https://kytoc.vn/"
  license: "AGPL-3"
  
business_context:
  purpose: "[Một câu mô tả addon làm gì]"
  primary_users: "[Ai dùng addon này - ví dụ Sales managers, Warehouse staff]"
  key_features:
    - "[Tính năng 1 - ví dụ Theo dõi thuộc tính sản phẩm tùy chỉnh]"
    - "[Tính năng 2 - ví dụ Sinh báo cáo chuyên biệt]"
    - "[Tính năng 3 - ví dụ Tự động hóa phê duyệt]"
  integration_points:
    - "[Tích hợp 1 - ví dụ Mở rộng quản lý sản phẩm]"
    - "[Tích hợp 2 - ví dụ Tích hợp với sale orders]"

technical_structure:
  depends:
    - "base"
    - "web"
    - "[dependency bổ sung - ví dụ sale, stock, account]"
  
  main_model:
    name: "[model.name - ví dụ custom.tracking]"
    description: "[Mô tả model]"
    inherits: 
      - "mail.thread"
      - "mail.activity.mixin"
    
  key_fields:
    basic:
      - name: "name"
        type: "Char"
        description: "Tên bản ghi"
        required: true
        tracking: true
      
      - name: "description"
        type: "Text"
        description: "Mô tả chi tiết"
        
      - name: "active"
        type: "Boolean"
        description: "Trạng thái kích hoạt"
        default: true
        tracking: true
    
    relationships:
      - name: "company_id"
        type: "Many2one"
        relation: "res.company"
        description: "Công ty"
        required: true
        default: "lambda self: self.env.company"
      
      - name: "user_id"
        type: "Many2one"
        relation: "res.users"
        description: "Người phụ trách"
        default: "lambda self: self.env.user"
        tracking: true
    
    workflow:
      - name: "state"
        type: "Selection"
        options:
          - value: "draft"
            label: "Draft"
          - value: "confirmed"
            label: "Confirmed"
          - value: "done"
            label: "Done"
        default: "draft"
        tracking: true

  business_methods:
    - name: "action_confirm"
      description: "Xác nhận bản ghi"
      logic: "Đổi state từ draft sang confirmed"
    
    - name: "action_done"
      description: "Đánh dấu hoàn tất"
      logic: "Đổi state sang done"

  constraints:
    - name: "_check_name"
      field: "name"
      validation: "Name không được rỗng"
      
views_structure:
  form_view:
    sections:
      - name: "header"
        components:
          - "nút hành động"
          - "statusbar"
      
      - name: "sheet"
        components:
          - "title (trường name)"
          - "nhóm thông tin cơ bản"
          - "notebook với mô tả"
      
      - name: "chatter"
        components:
          - "followers"
          - "activities"
          - "messages"
  
  tree_view:
    columns:
      - "name"
      - "user_id"
      - "state"
      - "company_id (multi-company groups)"
  
  search_view:
    filters:
      - name: "my_records"
        domain: "[('user_id', '=', uid)]"
      
      - name: "draft"
        domain: "[('state', '=', 'draft')]"
    
    group_by:
      - "state"
      - "user_id"

menu_structure:
  root_menu:
    id: "menu_[addon_name]_root"
    name: "[Addon Display Name]"
    sequence: 100
  
  sub_menus:
    - id: "menu_[model_name]"
      name: "[Model Display Names]"
      action: "action_[model_name]"
      sequence: 10

security_configuration:
  access_rules:
    - id: "access_[model_name]_user"
      model: "[model.name]"
      group: "base.group_user"
      permissions:
        read: true
        write: true
        create: true
        unlink: true
    
    - id: "access_[model_name]_manager"
      model: "[model.name]"
      group: "base.group_system"
      permissions:
        read: true
        write: true
        create: true
        unlink: true

data_configuration:
  initial_data:
    description: "[Mô tả dữ liệu cấu hình ban đầu]"
    records: "[Liệt kê bản ghi cần thiết]"
  
  demo_data:
    - record_id: "demo_[model_name]_1"
      name: "Demo [Model Name] 1"
      description: "Demo record đầu tiên"
    
    - record_id: "demo_[model_name]_2"
      name: "Demo [Model Name] 2"
      description: "Demo record thứ hai"

testing_strategy:
  manual_tests:
    - test: "Tạo bản ghi mới"
      steps:
        - "Vào menu addon"
        - "Nhấn Create"
        - "Điền các trường bắt buộc"
        - "Lưu bản ghi"
      expected: "Tạo bản ghi thành công"
    
    - test: "Chuyển trạng thái workflow"
      steps:
        - "Tạo bản ghi draft"
        - "Nhấn Confirm"
        - "Kiểm tra state thay đổi"
      expected: "State chuyển sang confirmed"
  
  validation_checks:
    - "Cài addon không lỗi"
    - "Menu hiển thị đúng"
    - "CRUD hoạt động"
    - "Logic nghiệp vụ chạy đúng"
    - "Phân quyền bảo mật đúng"

documentation:
  readme_sections:
    - "Mô tả ngắn"
    - "Danh sách tính năng chính"
    - "Hướng dẫn sử dụng"
    - "Ghi chú cấu hình"
  
  help_content:
    description: "[Mô tả thân thiện cho phần help]"
    usage_tips:
      - "[Mẹo 1 - ví dụ đặt tên có nghĩa để dễ quản lý]"
      - "[Mẹo 2 - ví dụ Confirm để khóa bản ghi cho xử lý]"

file_structure:
  required_files:
    - "__init__.py (root)"
    - "__manifest__.py"
    - "models/__init__.py"
    - "models/[model_name].py"
    - "views/[model_name]_views.xml"
    - "views/menu_items.xml"
    - "security/ir.model.access.csv"
    - "data/initial_data.xml"
    - "demo/demo_data.xml"
    - "README.rst"
    - "static/description/index.html"
  
  optional_files:
    - "wizards/ (nếu cần wizard)"
    - "reports/ (nếu cần báo cáo tùy chỉnh)"
    - "static/src/js/ (nếu cần JS)"
    - "tests/ (cho kiểm thử tự động)"

deployment_checklist:
  pre_installation:
    - "Kiểm tra cấu trúc addon"
    - "Kiểm tra cú pháp Python"
    - "Validate các file XML"
    - "Xác minh manifest"
  
  installation:
    - "Cài trên DB test"
    - "Đảm bảo không lỗi cài đặt"
    - "Kiểm tra điều hướng menu"
    - "Test CRUD cơ bản"
  
  post_installation:
    - "Xác minh logic nghiệp vụ"
    - "Test chuyển trạng thái workflow"
    - "Kiểm tra phân quyền"
    - "Kiểm tra load demo data"

customization_notes:
  extension_points:
    - "[Điểm mở rộng 1 - ví dụ override _compute_total]"
    - "[Điểm mở rộng 2 - ví dụ thêm field vào form]"
  
  integration_tips:
    - "[Mẹo tích hợp 1 - ví dụ depends=['sale'] để tích hợp sale]"
    - "[Mẹo tích hợp 2 - ví dụ tuân naming convention hiện có]"
  
  performance_considerations:
    - "[Mẹo hiệu năng 1 - ví dụ thêm index cho field tìm kiếm]"
    - "[Mẹo hiệu năng 2 - ví dụ tiết chế dùng computed fields]"

future_enhancements:
  planned_features:
    - "[Tính năng tương lai 1 - ví dụ dashboard báo cáo nâng cao]"
    - "[Tính năng tương lai 2 - ví dụ tích hợp mobile app]"
    - "[Tính năng tương lai 3 - ví dụ tích hợp API ngoài]"
  
  scalability_considerations:
    - "[Cân nhắc mở rộng 1 - ví dụ tối ưu cho dữ liệu lớn]"
    - "[Cân nhắc mở rộng 2 - ví dụ thêm cache cho computed fields]"