Repository
OCA/hr-expense · module folder · Try on Runboat
Module version
1.1.1
Category
Human Resources
Folder size
0.16 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/hr-expense
Last tracking update
2026-08-07 08:42:58
Authors
Odoo Community Association (OCA), Ecosoft
Maintainers
Odoo Community Association (OCA), Ecosoft
Committers
Saran440, Christopher Rogos, Weblate, Eduardo de Miguel, OCA-git-bot, oca-ci, David Bañón
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
hr_expense_advance_clearing_sequence, l10n_th_account_tax_expense, l10n_th_tier_department_demo
Description
Standard Expenses module allow employee to do the expense reimbursement
only after the expense has been made. In other world, employee will need
to pay first and reimburse later.

This module, allow company to advance an amount to the employee.
Employee can then use that advance amount to purchase product/service
first, then back to company and do the clearing.

There can be 3 scenarios for advance and clearing

- When clearing amount = advance amount, no other operation is required.
- When clearing amount \> advance amount, company will pay the extra to
  employee.
- When clearing amount \< advance amount, employee will return the
  remain to company.

Code Analysis

Views touched (10)
XML IDNameModelTypeStatus
hr_employee_public_view_form hr.employee.public.form hr.employee.public form Inherits hr.hr_employee_public_view_form
hr_expense_sheet_view_search hr.expense.sheet.view.search hr.expense.sheet search Inherits hr_expense.hr_expense_sheet_view_search
hr_expense_view_form hr.expense.view.form hr.expense form Inherits hr_expense.hr_expense_view_form
hr_expense_view_search hr.expense.view.search hr.expense search Inherits hr_expense.hr_expense_view_search
res_config_settings_view_form res.config.settings.view.form.inherit.hr.expense.advance.clearing res.config.settings form Inherits hr_expense.res_config_settings_view_form
view_account_payment_form account.payment.form account.payment form Inherits account.view_account_payment_form
view_account_payment_search account.payment.search account.payment search Inherits account.view_account_payment_search
view_employee_form hr.employee.form hr.employee form Inherits hr.view_employee_form
view_hr_expense_sheet_form hr.expense.sheet.form hr.expense.sheet form Inherits hr_expense.view_hr_expense_sheet_form
view_hr_expense_sheet_list hr.expense.sheet.list hr.expense.sheet list Inherits hr_expense.view_hr_expense_sheet_tree
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (8)

New fields (0)

No new fields.

Public methods (3)
  • action_force_register_payment(self)
    Odoo core does not allow register payment with type 'entry'. However, a payment can be registered when clearing a document, provided the amount cleared exceeds the advance payment.
  • button_cancel(self)
  • button_draft(self)

New fields (1)
  • advance_id Many2one → hr.expense.sheet
    comodel_name='hr.expense.sheet' readonly=True
Public methods (1)
  • action_post(self)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • advance_count Integer
    compute='_compute_advance_count' help='Count advance sheet in expense report' string='# of Advance'
  • advance_sheet_ids One2many → hr.expense.sheet
    comodel_name='hr.expense.sheet' domain=[('advance', '=', True)] inverse_name='employee_id' readonly=True
Public methods (1)
  • action_open_advance_clearing(self)

New fields (3)
  • advance Boolean
    default=False string='Employee Advance'
  • av_line_id Many2one → hr.expense
    comodel_name='hr.expense' help='Expense created from this advance expense line' ondelete='set null' string='Ref: Advance'
  • clearing_product_id Many2one → product.product
    comodel_name='product.product' domain="[('can_be_expensed', '=', True),'|', ('company_id', '=', False), ('company_id', '=', company_id)]" help='Optional: On the clear advance, the clearing product will create default product line.' ondelete='restrict' string='Clearing Product' tracking=True
Public methods (1)
  • onchange_advance(self)
    @api.onchange('advance')

New fields (10)
  • advance Boolean
    string='Employee Advance'
  • advance_sheet_id Many2one → hr.expense.sheet
    comodel_name='hr.expense.sheet' domain="[('advance', '=', True), ('employee_id', '=', employee_id), ('clearing_residual', '>', 0.0)]" help='Show remaining advance of this employee' string='Clear Advance'
  • advance_sheet_residual Monetary
    help='Remaining amount to clear the selected advance sheet' related='advance_sheet_id.clearing_residual' store=True string='Advance Remaining'
  • amount_payable Monetary
    compute='_compute_amount_payable' help='Final regiter payment amount even after advance clearing' string='Payable Amount'
  • clearing_count Integer
    compute='_compute_clearing_count'
  • clearing_journal_id Many2one → account.journal
    check_company=True comodel_name='account.journal' compute='_compute_clearing_journal_id' domain="[('type', '=', 'general')]" help='Miscellaneous journal used to post the clearing journal entry.' readonly=False store=True
  • clearing_residual Monetary
    compute='_compute_clearing_residual' help='Amount to clear of this expense sheet in company currency' store=True string='Amount to clear'
  • clearing_sheet_ids One2many → hr.expense.sheet
    comodel_name='hr.expense.sheet' help='Show reference clearing on advance' inverse_name='advance_sheet_id' readonly=True string='Clearing Sheet'
  • payment_return_ids One2many → account.payment
    comodel_name='account.payment' help='Show reference return advance on advance' inverse_name='advance_id' readonly=True string='Payment Return'
  • return_count Integer
    compute='_compute_return_count' compute_sudo=True
Public methods (7)
  • action_open_clearings(self)
  • action_open_payment_return(self)
  • action_register_payment(self)
  • action_sheet_move_post(self)
    Post journal entries with clearing document
  • create_clearing_expense_line(self, line)
  • get_domain_advance_sheet_expense_line(self)
  • open_clear_advance(self)

New fields (1)
  • clearing_journal_id Many2one → account.journal
    check_company=True comodel_name='account.journal' domain="[('type', '=', 'general')]" help='Default Miscellaneous journal used when posting the advance clearing journal entry.' string='Default Clearing Journal'
Public methods (0)

No public methods.

New fields (1)
  • clearing_journal_id Many2one → account.journal
    check_company=True comodel_name='account.journal' domain="[('type', '=', 'general')]" readonly=False related='company_id.clearing_journal_id'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
84 days ago
Last activity
0 days ago
Repository
OCA/hr-expense
Pull request
[19.0][MIG] hr_expense_advance_clearing: Migration to 19.0 (#358)