- Add context check for 'show_full_path' in name_get method
- Support both short names (default) and full path (optional)
- Enhanced display_name property with same flexibility
- Maintain backward compatibility with existing fields
Usage:
- Default: <field name="department_id"/> (short name)
- Full path: <field name="department_id" context="{'show_full_path': True}"/>
Synced with latest dev_odex25_hr on Thu Nov 13 22:22:02 +03 2025
- Remove complex logic from name_get method
- Simplify display_name property
- Show department.name directly for all departments/branches
- Remove dependency on context variables
Synced with latest dev_odex25_hr on Thu Nov 13 21:45:35 +03 2025
🚨 **Critical XML Fix**
Fixed ValidationError: الحقل department_id غير موجود في النموذج hr.department
## 🔧 **Problem Fixed**
- Removed invalid department_id field from hr.department form view
- Removed department_id field and grouping from hr.department search view
- hr.department cannot reference itself via department_id field
## 📁 **Files Modified**
- odex25_hr/hr_base/views/hr_base_view.xml: Removed invalid department_id references
## ✅ **Impact**
- Fixes XML validation error during module upgrade
- Maintains proper model field relationships
- Allows successful hr_base module loading
## 🔗 **Related**
Fixes error in PR #5412 - Department display enhancement
🔧 **Key Improvements:**
- Extended name_get to support show_department_short context
- Added display_name property override for consistent short display
- Enhanced tree view with department context for clean display
- Fixed translation consistency (Department = القسم)
📁 **Files Modified:**
- odex25_hr/hr_base/models/hr_department.py: Enhanced name_get and added display_name property
- odex25_hr/hr_base/views/hr_base_view.xml: Added context to department fields in all views
- odex25_hr/hr_base/i18n/ar_001.po: Unified Department translation to القسم
✅ **Impact:**
- Department names now display without hierarchical path when context is set
- Consistent short name display across all HR views (form, tree, search)
- Unified Arabic translation for better UX
- Maintains backward compatibility with existing functionality
Synced with latest dev_odex25_hr on Thu Nov 13 18:25:53 +03 2025
- Modified name_get method to prioritize is_branch flag
- Branch departments (is_branch=True) now always show name only
- Maintains context support for other cases
- Fixes issue where branch names showed full hierarchical path
- Ensures consistent short name display across all related fields
Files modified:
- odex25_hr/hr_base/models/hr_department.py
This resolves the issue where branch names appeared with full path
even when context was provided for short display.
- Fixed tree view XPath from 'name' to 'display_name' (matches Odoo 14 standard)
- Fixed search view groupby filter position to use 'inactive' filter reference
- Ensures proper inheritance of hr.department views
- Resolves XML validation error during module upgrade
Files modified:
- odex25_hr/hr_base/views/hr_base_view.xml
Fixes XPath validation error in hr_department tree view inheritance
- Modified name_get method in hr.department for short branch display
- Added context support for show_branch_short and from_branch_field
- Updated HR views to use short branch name context
- Added branch field to department tree view with context
- Added branch field to department search view with groupby filter
- Added Arabic translations for branch field
Files modified with correct paths:
- odex25_hr/hr_base/models/hr_department.py
- odex25_hr/hr_base/views/hr_base_view.xml
- odex25_hr/hr_base/i18n/ar_001.po
Synced with latest dev_odex25_hr on Thu Nov 13 14:49:04 +03 2025
- Modified name_get method in hr.department to show short branch names
- Added context support for 'from_branch_field' and 'show_branch_short'
- Updated hr_base_view.xml to use short branch name context
- Branch names now display without hierarchical path when requested
Synced with latest dev_odex25_hr on Thu Nov 13 12:45:02 +03 2025