Odoo
Implementation
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Employees (hr)
• Manufacturing (mrp) • Payroll (hr_payroll) • Accounting (accountant) • Invoicing (account) • Discuss (mail) • Attendances (hr_attendance) • Employee Contracts (hr_contract) • Time Off (hr_holidays) • Calendar (calendar) • Inventory (stock) • Purchase (purchase) • Sales (sale_management) |
| Community Apps Dependencies | Show |
| Lines of code | 8410 |
| Technical Name |
add_branch_on_hr_modules |
| License | LGPL-3 |
| Website | https://lucidbrainz.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Employees (hr)
• Manufacturing (mrp) • Payroll (hr_payroll) • Accounting (accountant) • Invoicing (account) • Discuss (mail) • Attendances (hr_attendance) • Employee Contracts (hr_contract) • Time Off (hr_holidays) • Calendar (calendar) • Inventory (stock) • Purchase (purchase) • Sales (sale_management) |
| Community Apps Dependencies | Show |
| Lines of code | 8410 |
| Technical Name |
add_branch_on_hr_modules |
| License | LGPL-3 |
| Website | https://lucidbrainz.com |
HR Branch Management - Multi-Branch Employee & Payroll Control
Complete Branch-Based Access Control for Employees, Attendance Sheets, Payslips & HR Operations - Seamless Multi-Branch Management for Odoo 18
Overview
HR Branch Management by
LucidBrainz is a comprehensive multi-branch solution for Odoo 18 that
adds intelligent branch-based filtering and access control across all critical HR modules:
Employees, Attendance Sheets, Payslips, and Attendance Batches.
Say goodbye to manual data segregation and security headaches! This powerful module helps you
organize employees by branch locations, restrict user access to specific branches,
auto-populate branch fields, enforce branch-based security rules, and maintain clean data separation.
Perfect for multi-branch companies, regional HR managers, franchise operations,
retail chains, manufacturing plants with multiple locations, distributed organizations,
companies with remote offices, and any business that needs location-based HR management, decentralized payroll processing,
branch-wise attendance tracking, or secure multi-branch access control.
The module features automatic branch field addition to Employee, Attendance Sheet, Payslip, and Batch models,
intelligent default branch assignment from user settings, domain restrictions showing only accessible branches,
powerful record rules filtering data by user's assigned branches, clean form view integrations,
list view columns for branch visibility, seamless integration with existing HR workflows,
and zero configuration required after installation.
It intelligently manages four critical areas:
(1) Employee Records - Assign employees to specific branches with automatic filtering so HR managers see only their branch staff,
(2) Attendance Sheets - Track attendance by branch with location-based access control ensuring data privacy,
(3) Payslips - Process payroll by branch with automatic branch tagging for accurate cost allocation,
(4) Attendance Batches - Manage batch processing at branch level with streamlined approval workflows.
The system gives you complete organizational control through sophisticated record rules with domain:
['|',('branch_id','=',False),('branch_id','in',user.branch_ids.ids)],
allowing users to access either records without branch assignment OR records from their assigned branches.
When you install the module, it automatically adds branch_id fields to all relevant models with
Many2one relationship to res.branch, default value from user's primary branch,
and domain filtering to user's accessible branches, presenting everything in
beautifully integrated form views with proper field positioning,
list view columns, and search/filter capabilities.
The security rule applies to the Internal User group (base.group_user), ensuring all standard users
automatically benefit from branch-based filtering without additional configuration.
Ideal for businesses that want to improve data security by 100%, streamline branch operations,
decentralize HR management, maintain compliance across locations, simplify user access control,
eliminate data privacy concerns, enable autonomous branch HR teams, reduce administrative overhead,
and scale HR operations effortlessly as your organization grows across multiple locations!
Key Features
- Employee Branch Assignment: Add branch_id field to hr.employee model. Employees automatically assigned to branches based on user's default branch. Form view shows branch field after company_id for easy management
- Attendance Sheet Branch Tracking: Inherits attendance.sheet model adding branch field. Displays after work_location_id in form view. Ensures attendance data segregated by branch location
- Payslip Branch Control: Extends hr.payslip with branch_id field. Shows branch after payslip number in form view. Enables branch-wise payroll processing and cost allocation
- Attendance Batch Branch Management: Adds branch to attendance.sheet.batch model. Displays after batch name field. Streamlines batch processing for specific branches
- Auto-Population from User Settings: All branch fields use lambda default: self.env.user.branch_id.id. Automatically fills branch when creating new records. No manual selection needed for most cases
- Domain Filtering: Branch dropdowns limited by domain: [('id', 'in', self.env.user.branch_ids.ids)]. Users see only branches they have access to. Prevents unauthorized branch assignment
- Security Record Rules: Implements ir.rule on hr.employee model. Rule name: "Employee multi company rule". Domain: ['|',('branch_id','=',False),('branch_id','in',user.branch_ids.ids)]
- Data Access Control: Users access records with no branch OR records from their assigned branches. Automatic filtering at database level. Complete data isolation between branches
- Internal User Group Application: Security rule applied to base.group_user (Internal Users). All standard Odoo users automatically protected. No additional group configuration needed
- List View Integration: Branch column added to employee tree/list view. Displays after department_id field. Optional="show" attribute for user preference control
- Search & Filter Support: Branch field searchable in all models. Can filter records by branch. Group by branch option in search views for organized data viewing
- Clean Model Inheritance: Uses proper Odoo inheritance pattern (_inherit). Extends existing models without modifying core code. Maintains upgrade compatibility
- XPath View Inheritance: All view modifications use XPath expressions. Positions fields correctly relative to existing fields. Clean XML structure following Odoo standards
- Many2one Relationship: All branch fields use Many2one('res.branch'). Proper relational database design. Ensures data integrity and referential consistency
- Branch Module Integration: Depends on 'branch' base module. Seamlessly works with existing branch infrastructure. Leverages res.branch model and user branch assignments
- HR Module Coverage: Extends hr (Employees), hr_payroll (Payslips), hr_attendance_sheet (Attendance tracking), att_sheet_batch (Batch processing). Complete HR ecosystem integration
- Zero Configuration Required: Works immediately after installation. No setup wizards or configuration screens. Branch assignments inherited from user settings automatically
- Multi-Branch Architecture: Supports unlimited number of branches. Users can be assigned to multiple branches (branch_ids). Flexible organizational structure support
- Existing Data Compatibility: Security rule allows records with branch_id=False. Existing records without branch continue working. Gradual migration supported
- Transparent Operation: Branch filtering happens automatically in background. Users don't see records outside their branches. Natural user experience without artificial restrictions
- Form View Field Positioning: Employee: after company_id | Attendance Sheet: after work_location_id | Payslip: after number | Batch: after name. Logical field placement
- Clean Python Code: Separate model files for each extension. Clear file structure: hr_employee.py, att_sheet.py, hr_payslip.py, att_sheet_batch.py. Easy maintenance
- Organized File Structure: Models in models/ folder. Views in views/ folder. Separate XML files per model. Professional module organization
- Database Efficiency: Branch filtering at SQL level via record rules. No performance impact on queries. Indexes on branch_id fields for fast filtering
- User Branch Configuration: Administrators manage user branch access through user settings. branch_id (primary) and branch_ids (multiple access). Flexible permission model
- Scalability Support: Handles thousands of employees across hundreds of branches. Efficient filtering ensures performance. No degradation as organization grows
- Duplicate Record Prevention: Branch assignment prevents accidental duplicate processing. Clear ownership of records. Audit trail by branch
- Reporting Ready: Branch field available in all reports. Filter/group reports by branch. Branch-wise analytics and dashboards possible
- Regional Management Support: Ideal for companies with regional structure. Country/state/city level branch organization. International operations compatible
- Easy to Extend: Clean architecture allows easy customization. Add branch field to other models following same pattern. Developer-friendly codebase
Module Screenshots
Employee record "Abigail Peterson" showing branch field integrated into the form.
Branch field displays below Company field with dropdown showing accessible branches.
Note: Branch automatically populated from user's default branch setting.
Attendance sheet showing branch field positioned after Work Location.
Employee, Period, Attendance Policy, and Branch fields visible.
Branch dropdown restricted to user's assigned branches via domain filtering.
Payslip for "Anita Oliver" showing branch field integration.
Branch appears in form along with Contract, Batch, Structure, and Period information.
Enables branch-wise cost allocation and payroll segregation.
"Employee multi company rule" showing domain force configuration:
['|',('branch_id','=',False),('branch_id','in',user.branch_ids.ids)]Applied to "Public Employee" model with Read, Write, Create, Delete permissions.
Rule ensures users see only their branch employees automatically.
Our Services
Odoo
Customization
Odoo
Migration
Support &
Maintenance
📞 Contact Us
WhatsApp:
Email:
Website: |
🌐 Follow Us📘 Facebook 📸 Instagram 💼 LinkedIn 🎥 YouTube |
© 2025 LucidBrainz | All Rights Reserved
Please log in to comment on this module