Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
34972fa
[12.0][ADD] hr_expense_advance_clearing
kittiu Apr 26, 2019
d5b269c
[12.0][FIX] hr_expense_advance_clearing
kittiu Dec 9, 2019
db2b074
[IMP] : black, isort
kittiu Mar 20, 2020
7a74eea
[13.0][MIG] hr_expense_advance_clearing
kittiu Mar 20, 2020
817787a
[FIX] hr_expense_advance_clearing: analytic account visibility
chienandalu Sep 24, 2020
4e4e5f8
[IMP] hr_expense_advance_clearing: hide analytics tags as well
chienandalu Nov 5, 2020
f638c91
[FIX] rename fields residual
Saran440 Jan 7, 2021
c28b5ff
[14.0][IMP] hr_expense_advance_clearing, add invisible fields
kittiu Jul 20, 2021
95c6a3f
[14.0][IMP] hr_expense_advance_clearing, allow predefined clearing pr…
kittiu Jul 20, 2021
895d647
[IMP] clearing tab on advance sheet
Saran440 Jul 21, 2021
410a025
[14.0][IMP] hr_expense_advance_clearing, add invisible fields on tree…
kittiu Jul 25, 2021
50b5cad
[14.0][FIX] hr_expense_advance_clearing, fix access right on .read()
kittiu Jul 29, 2021
f5b5cb3
[IMP] hr_expense_advance_cleaing: show advance on employee view
Saran440 Aug 18, 2021
5bf2cc6
[14.0][IMP] hr_expense_advance_clearing, add menus Advance/Expense
kittiu Nov 2, 2021
1b20fd5
[FIX] constrains with advance clearing
Saran440 Nov 9, 2021
2ddd381
[FIX] hr_expense_advance_clearing: add Clear Advance on tree view
ps-tubtim Nov 11, 2021
b6671b4
[FIX] skip_account_move_synchronization on post journal entries
Saran440 Nov 18, 2021
80315ce
[14.0][FIX] hr_expense_advance_clearing, make expense_line_ids readon…
kittiu Nov 10, 2021
814089a
[FIX] onchange clearing advance for hooks
Saran440 Nov 22, 2021
4d3e926
[FIX] hr_expense_advance_clearing: add context for clearing
ps-tubtim Nov 26, 2021
f5edf57
[15.0][MIG] hr_expense_advance_clearing]
kittiu Mar 3, 2022
07cfa99
[FIX] do not allow cancel PV related clearing or return
Saran440 Mar 26, 2022
8272c9b
[14.0][FIX] hr_expense_advance_clearing: allow general user to create…
ps-tubtim Nov 14, 2022
6dca528
[15.0][FIX] hr_expense_advance_clearing: zero unit price
ps-tubtim Feb 16, 2023
8a7ef80
[FIX] hr_expense_advance_clearing: change field not compute advance
Saran440 Mar 16, 2023
ed1cef7
Added translation using Weblate (Italian)
mymage Jun 30, 2023
c8216eb
Translated using Weblate (Italian)
mymage Jul 4, 2023
bd05208
Translated using Weblate (Italian)
mymage Nov 30, 2023
f560084
[FIX] hr_expense_advance_clearing: clear advance partial
Saran440 Jun 24, 2024
4ec954f
[FIX] hr_expense_advance_clearing: fetch the product considering the …
marcelsavegnago Aug 2, 2024
7e74c7e
[FIX] hr_expense_advance_clearing: Fix + improve tests
victoralmau Nov 27, 2024
07c9b92
Added translation using Weblate (Thai)
Saran440 May 21, 2025
b8c0fb4
Added translation using Weblate (Thai (th_TH))
Saran440 May 23, 2025
8cc55f9
[IMP] hr_expense_advance_clearing: post migration cleanup
CRogos May 23, 2025
999347f
[FIX] hr_expense_advance_clearing: Check approval before other modul…
david-banon-tecnativa Jul 7, 2025
63264dc
Translated using Weblate (Italian)
mymage Jul 11, 2025
b974bbd
[REF] hr_expense_advance_clearing: Check if all moves are posted (com…
Shide Dec 3, 2025
1118aca
[IMP] hr_expense_advance_clearing: pre-commit auto fixes
dnplkndll Jun 19, 2026
2b2e249
[MIG] hr_expense_advance_clearing: Migration to 19.0
dnplkndll Jun 19, 2026
1335c55
[IMP] hr_expense_advance_clearing: book clearing as journal entries
dnplkndll Jun 19, 2026
e3c77d3
[FIX] hr_expense_advance_clearing: return_count compute_sudo
dnplkndll Jun 30, 2026
adef2e7
[FIX] hr_expense_advance_clearing: carry advance analytic to the clea…
dnplkndll Jun 30, 2026
46beeb8
[FIX] hr_expense_advance_clearing: register return-advance on the adv…
dnplkndll Jun 30, 2026
9adaf26
[FIX] hr_expense_advance_clearing: skip invoice sync on clearing rese…
dnplkndll Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions hr_expense_advance_clearing/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============================
Employee Advance and Clearing
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9cfb71123c60ec1d5ee097d027b63702b0f0841b0babdd697b92d1136536d388
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--expense-lightgray.png?logo=github
:target: https://github.com/OCA/hr-expense/tree/19.0/hr_expense_advance_clearing
:alt: OCA/hr-expense
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-expense-19-0/hr-expense-19-0-hr_expense_advance_clearing
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module lets the company pay an advance to an employee and later
clear it against the expenses they actually incur. The employee records
an advance expense, gets paid for it, then files regular expenses that
reconcile against the advance. When an advance is over-spent the
employee registers a payment for the difference, and when it is
under-spent they return the unused balance to the company.

**Table of contents**

.. contents::
:local:

Configuration
=============

This module will create a new product "Employee Advance" automatically.
You will need to setup the Expense Account of this product to your
Employee Advance account manually.

- Open Product window and search for "Employee Advance"
- On Accounting tab, select appropriate employee advance account from
your chart of account

Note:

- You will need the "Show Full Accounting Features" to see accounting
data
- Employee Advance account code, if not already exists, you can create
one. Use type = Current Asset and check Allow Reconciliation.

Usage
=====

First-time setup: open product **Employee Advance** (auto-created on
install) and set its expense account to your "Employee Advance"
current-asset account with ``Allow Reconciliation``.

**Create an Employee Advance**

1. Expenses → My Expenses, click New.
2. Set ``Expense Type`` to **Advance** (Employee Advance product +
own_account auto-fill).
3. Optionally set ``Clearing Product`` — it's the default product for
clearing expense lines that reference this advance.
4. Set the amount, Save.
5. Submit → Approve → Post → Register Payment. The advance is paid to
the employee.

**Clear the Advance with a regular expense**

1. Expenses → My Expenses, New (or pick an existing draft).
2. Leave ``Expense Type`` as **Expense** and set ``Clearing Advance`` to
the advance you want to clear against. The ``Advance Remaining``
smart field shows what's left of the advance.
3. Submit → Approve → Post. On post, the clearing expense's receivable
line auto-reconciles against the advance's receivable line.

What happens at post time:

- ``clearing_total ≤ advance_residual`` → fully covered. No further
payment needed; the advance's residual updates.
- ``clearing_total > advance_residual`` → the excess remains on the
clearing expense's move. Register Payment for the difference.

**Return unused advance**

1. Open the paid advance with ``clearing_residual > 0``.
2. Click **Return Advance** (header button). The Register Payment wizard
opens pre-filled with the residual.
3. Confirm. The advance is now fully closed; ``clearing_residual = 0``.

**Trip integration** (when ``hr_expense_trip`` is installed)

A trip's ``expense_ids`` can include both an advance and the regular
expenses paid out of it. The trip module wires a "Clear Trip" button
that calls ``action_clear_advance`` on the trip's regular expenses with
the trip's advance as the target. This module does not depend on
``hr_expense_trip``; the integration is one-way from the trip side.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-expense/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ecosoft

Contributors
------------

- Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
- Tharathip Chaweewongphan <tharathipc@ecosoft.co.th>
- Saran Lim. <saranl@ecosoft.co.th>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/19.0/hr_expense_advance_clearing>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions hr_expense_advance_clearing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizard
20 changes: 20 additions & 0 deletions hr_expense_advance_clearing/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2019 Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Employee Advance and Clearing",
"version": "19.0.1.0.0",
"category": "Human Resources",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/hr-expense",
"depends": ["hr_expense"],
"data": [
"data/advance_product.xml",
"views/account_payment_view.xml",
"views/hr_expense_views.xml",
"views/hr_employee_views.xml",
"views/hr_employee_public_views.xml",
],
"installable": True,
}
16 changes: 16 additions & 0 deletions hr_expense_advance_clearing/data/advance_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="product_emp_advance" model="product.product">
<field name="name">Employee Advance</field>
<field name="default_code" />
<field name="type">service</field>
<field name="sale_ok" eval="False" />
<field name="purchase_ok" eval="False" />
<!-- 19.0: advance is itself an hr.expense, so the product must be
expensable (was False in 18.0 because advance lived on the
sheet, not the expense). -->
<field name="can_be_expensed" eval="True" />
<field name="supplier_taxes_id" eval="False" />
<field name="taxes_id" eval="False" />
</record>
</odoo>
Loading
Loading