⚠️ HIGH |
Category: Odoo Tips |
ID: T03 |
Owner: CEO
T03 — Odoo 19 Leave Management: field names thay đổi so với docs
Vấn đề
Tài liệu Odoo (cả official docs lẫn community) liệt kê nhiều field names không tồn tại trong Odoo 19 SaaS. Nếu dùng trong script XML-RPC sẽ gặp ValueError: Invalid field.
Chi tiết
hr.leave.type
| Field theo docs/cũ | Thực tế Odoo 19 | Ghi chú | |---|---|---| |allocation_type (selection) | requires_allocation (boolean) | True = cần allocation; False = no limit |
| work_entry_type_id | KHÔNG CÓ | WET gán tự động theo unpaid flag |
| time_type | Vẫn có | 'leave' = absence, 'other' = worked time |
hr.version (= hr.contract trong Odoo cũ)
| Field theo docs | Thực tế | Ghi chú | |---|---|---| |employment_type_id | contract_type_id | many2one → ET đã tạo (id 14-20) |
| is_current | Có nhưng computed, không filterable | Filter trong Python, không domain |
hr.work.entry.type
| Field theo docs | Thực tế | Ghi chú | |---|---|---| |time_type | KHÔNG CÓ | Dùng is_leave, is_work (boolean) |
hr.leave.allocation
| Method | Thực tế | Ghi chú | |---|---|---| |action_validate | action_approve | Approve allocation |
| allocation_type | 'regular' hoặc 'accrual' | Selection trên allocation, không trên leave type |
Accrual carryover
carryover_date='other', carryover_day='1', carryover_month='4'carryover_options='limited' + postpone_max_days=2Áp dụng khi
Invalid field trên models hr_holidaysRef
/root/odoo_daily_operation/HR/scripts/08_setup_leave_management.py/root/odoo_daily_operation/HR/guides/04_time_off.md
📚 Published from Company Knowledge Base — T03
Last updated: 2026-03-11
Review by: 2026-06-09