Skip to Content
Skip to content
Odoo Functional

Employee Self-Service in Odoo: Leaves and Expenses Through the Portal

Give every employee leave requests, expense claims and documents through the Odoo portal, without making each one an internal user.

  • Published
  • 3 minReading time
  • 6Sections
Employee Self-Service in Odoo: Leaves and Expenses Through the Portal

In a factory with 300 workers, maybe 30 people use Odoo every day. The other 270 still need to apply for leave, check their balance, claim a taxi fare and download a payslip. Making all of them internal users is expensive and gives them far more than they need. The Odoo portal is a better fit, and I've built leave and expense portals for several companies with exactly this profile.

Why the portal

  • Portal users are free and already used for customers and vendors. Employees get the same simple, mobile-friendly interface.
  • Least privilege by design. A portal user sees only what your controllers show them, nothing else in the database.
  • No training. A leave form with three fields doesn't need a training session.

Managers and HR stay internal users and approve in the backend, where the Time Off and Expenses apps give them dashboards, calendars and reports.

What employees can do

FeaturePortal pageBehind the scenes
Leave balance/my/leavesAllocations minus validated and pending leaves per type
Apply for leave/my/leaves/newCreates a leave request for the employee, notifies the manager
Claim an expense/my/expenses/newCreates an expense with the receipt photo attached
Track status/my/leaves, /my/expensesShows to approve, approved, refused or paid
Payslips/my/payslipsPDF download, if payroll runs in Odoo

Linking a portal user to an employee

Each employee record gets a link to its portal user, and every controller starts from that link. Never from a record id in the URL:

def _portal_employee(self):
    employee = request.env['hr.employee'].sudo().search(
        [('portal_user_id', '=', request.env.user.id)], limit=1)
    if not employee:
        raise request.not_found()
    return employee

@http.route('/my/leaves', type='http', auth='user', website=True)
def portal_my_leaves(self, **kw):
    employee = self._portal_employee()
    leaves = request.env['hr.leave'].sudo().search(
        [('employee_id', '=', employee.id)], order='request_date_from desc')
    return request.render('my_module.portal_my_leaves', {
        'employee': employee, 'leaves': leaves, 'page_name': 'leaves',
    })

Security rules that matter

  • Use sudo() only after you have resolved the employee from the logged-in user, and always filter by that employee.
  • Validate everything the form posts: allowed leave types only, dates in order, attachment size and type for receipts.
  • Let the standard models do the work: create the leave or expense through the ORM so durations, allocations and approval rules behave exactly as in the backend.
  • Log the request in the chatter as the employee, so HR has a full history.

Approvals and notifications

When a request is submitted, the employee's manager gets an activity in Odoo and an email with the request summary. Once it is approved or refused, the employee gets an email with a link back to the portal page. For teams without email, the same notification can go out over WhatsApp or SMS.

Results

In practice, paper leave forms disappear in the first month, HR stops re-typing requests, and managers approve from their phone. Above all, the company doesn't need to pay for 270 extra internal users.

Want a self-service portal for your team? Tell me what your employees need.

You've reached the endFound it useful? Share it with your team.
Topics #Automation#HR#Odoo 19#Portal
Share
Gautam Kundaria
Written by

Gautam Kundaria

Odoo Techno-Functional Consultant with 5+ years of implementing, migrating and customising Odoo for businesses worldwide.

Planning to do this in your Odoo?

I implement, customise and support Odoo for growing businesses. Tell me what you need and I will reply within 24 hours.

Chat on WhatsApp