Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
72c3689
[14.0][ADD] hr_expense_payment
Saran440 Jul 27, 2021
e221478
[ENH] hr_expense_cancel depend on hr_expense_payment
Saran440 Jul 27, 2021
1b8b98a
[UPD] Update hr_expense_payment.pot
oca-travis Mar 5, 2022
3a2b58b
[UPD] README.rst
OCA-git-bot Mar 5, 2022
b737b8d
[IMP] update dotfiles [ci skip]
OCA-git-bot Mar 30, 2022
1ffb8d6
[MIG]hr_expense_payment: Migration to 15.0
manuelregidor Apr 25, 2022
0810d0a
[UPD] Update hr_expense_payment.pot
Apr 26, 2022
2798f61
[UPD] README.rst
OCA-git-bot Apr 26, 2022
c5d27a3
[MIG] hr_expense_payment: Migration to 16.0
AungKoKoLin1997 Nov 24, 2022
faba8b1
[UPD] Update hr_expense_payment.pot
Jun 19, 2023
7397005
[UPD] README.rst
OCA-git-bot Jun 19, 2023
0afbb82
Added translation using Weblate (Italian)
mymage Jun 28, 2023
9d44afa
Translated using Weblate (Italian)
mymage Jun 28, 2023
869569c
[UPD] README.rst
OCA-git-bot Sep 3, 2023
a84cfb6
[FIX] no create payments with paid by company
Saran440 May 19, 2022
3dc4d93
[UPD] Update hr_expense_payment.pot
Nov 30, 2023
9fc9235
[BOT] post-merge updates
OCA-git-bot Nov 30, 2023
abffbda
Update translation files
weblate Nov 30, 2023
c406547
[IMP] hr_expense_payment: pre-commit auto fixes
Apr 4, 2024
3796105
[MIG] hr_expense_payment: Migration to 17.0
Apr 4, 2024
2b84f07
[UPD] Update hr_expense_payment.pot
May 24, 2024
9b06315
[BOT] post-merge updates
OCA-git-bot May 24, 2024
33ce15a
[FIX] hr_expense_payment: Fix + improve tests
victoralmau Nov 27, 2024
89ebf2f
[BOT] post-merge updates
OCA-git-bot Nov 27, 2024
a2719cc
[MIG] hr_expense_payment: Migration to 18.0
lef-adhoc Dec 4, 2024
6d37ded
[IMP] hr_expense_payment: Optimize _create_payment_vals_from_batch me…
lef-adhoc Jan 2, 2025
72c3ed3
[UPD] Update hr_expense_payment.pot
Jan 9, 2025
e917d51
[BOT] post-merge updates
OCA-git-bot Jan 9, 2025
f7a13e0
Update translation files
weblate Jan 9, 2025
994c4d7
Translated using Weblate (Italian)
mymage Jan 9, 2025
a50052c
[IMP] hr_expense_payment: pre-commit auto fixes
dnplkndll May 27, 2026
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
fe88988
[IMP] hr_expense_payment: pre-commit auto fixes
dnplkndll May 30, 2026
5f7aadb
[MIG] hr_expense_payment: Migration to 19.0
dnplkndll May 30, 2026
e522b06
[IMP] hr_expense_advance_clearing: pre-commit auto fixes
dnplkndll May 30, 2026
8d34ecc
[MIG] hr_expense_advance_clearing: Migration to 19.0
dnplkndll May 30, 2026
b3c909e
Merge remote-tracking branch 'fork/19.0-mig-hr_expense_payment' into …
dnplkndll Jun 19, 2026
a6990b9
Merge remote-tracking branch 'fork/19.0-mig-hr_expense_advance_cleari…
dnplkndll Jun 19, 2026
dc95b50
[ADD] hr_expense_payment_trip: pay a whole trip in one payment (proto…
dnplkndll Jun 19, 2026
97bb6af
[ADD] hr_expense_advance_clearing_trip: tie an advance to a trip (pro…
dnplkndll Jun 19, 2026
c899d39
Merge branch '19.0-demo-advance-clearing-trip' into 19.0-demo-trip-suite
dnplkndll Jun 19, 2026
d09452c
[DEMO] trip suite: combined branch + SMB sales-rep walk narrative
dnplkndll Jun 19, 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
43 changes: 43 additions & 0 deletions DEMO_trip_suite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# HR Expense — Trip suite demo (SMB sales-rep walk)

This branch stacks the optional **Trip** layer over the base hr-expense flow so it
can be installed + evaluated as one unit:

- `hr_expense_trip` — the optional Trip container (groups expense lines; approval
workflow draft → request → approve → collect receipts → done; trip PDF).
- `hr_expense_advance_clearing` + `hr_expense_advance_clearing_trip` — a **trip
advance = the budget** (cash issued for the trip, cleared against actual spend).
- `hr_expense_payment` + `hr_expense_payment_trip` — **reimburse the whole trip
in one payment**.

The Trip is **opt-in**: nothing changes about the plain per-expense flow unless a
trip is used.

## Scenario — a sales rep on the road

**Without a trip (base flow):** the rep files each expense individually (flight,
hotel, dinner). Each is approved and reimbursed on its own; there is no budget and
no grouping — fine for the occasional expense, noisy for a multi-day trip.

**With a trip:** the rep's manager opens a **Trip** ("Q1 East Coast Sales Tour"),
issues a **$2,000 advance** as the trip budget, and approves the trip. The rep
collects receipts against the trip; **Apply Advance** clears them against the
budget (Advance Remaining tracks what's left), and **Pay Trip** reimburses any
balance in one payment. One approval, one budget, one settlement.

| Need | Base | Trip |
|---|---|---|
| Group a multi-day trip's expenses | — | trip.expense_ids |
| Budget | — | advance ( $ issued up front ) |
| Approval | per expense | one trip approval workflow |
| Reimburse | per expense | one payment (Pay Trip) |
| Document | per expense | trip PDF report |

## Screenshots
- Trip with advance budget + Apply Advance ([advance demo](https://storage.googleapis.com/ledo-pr-assets/hr-expense/pr-3/advance-clearing-trip.png)).
- Trip form + batched expenses + state machine ([trip foundation](https://storage.googleapis.com/ledo-pr-assets/hr-expense/pr-1/01-buffer-form-flow-index.png) — see hr-expense#1 for the trip walk).

## Eval
Open this branch's runboat build (admin/admin) and follow the scenario above.
Note: in 19.0, expense posting routes through `hr.expense.post.wizard`, so for the
**Pay Trip** step do *Create Bill* → confirm the post wizard → **Pay Trip**.
187 changes: 187 additions & 0 deletions hr_expense_advance_clearing/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
.. 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:3399d5032631e32709c5c3793d190f99f145eee5605de1181d2698efad056214
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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|

Lets the company pay an "advance" to an employee, then later reconcile
that advance against the actual expenses incurred.

In Odoo 19.0 the workflow is per-expense (the 18.0 advance-sheet vs
clearing-sheet pair is gone with ``hr.expense.sheet``):

- An **advance expense** has ``expense_type='advance'``, uses the
``Employee Advance`` product, no taxes. Paid to the employee via the
standard ``action_pay``.
- A **clearing expense** is a regular ``hr.expense`` with
``clearing_advance_id`` set to the advance. On posting, its receivable
line auto-reconciles against the advance's receivable line.
- The advance's ``clearing_residual`` tracks the unreconciled balance.
When it hits zero, the advance is fully cleared.

Three scenarios remain:

- ``clearing_total = advance`` — fully reconciled, advance is closed.
- ``clearing_total > advance`` — Register Payment on the clearing
expense's difference (the wizard understands the ``expense_clearing``
context).
- ``clearing_total < advance`` — use **Return Advance** on the advance
expense to refund the residual back to the company.

19.0 note: ``hr_expense_trip`` (when available) is the natural clearing
scope — a "Clear Trip" button on the trip would call
``action_clear_advance`` on the trip's ``expense_ids``. Trip integration
lives in the trip module, not here.

**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.

.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu
.. |maintainer-dnplkndll| image:: https://github.com/dnplkndll.png?size=40px
:target: https://github.com/dnplkndll
:alt: dnplkndll

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kittiu| |maintainer-dnplkndll|

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 (http://www.gnu.org/licenses/agpl).

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

{
"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,
"maintainers": ["kittiu", "dnplkndll"],
}
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