Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0e946da
[12.0][ADD] hr_expense_advance_clearing_sequence
ps-tubtim Aug 17, 2020
941ce3c
[UPD] Update hr_expense_advance_clearing_sequence.pot
oca-travis Aug 17, 2020
fd96bf0
[IMP] hr_expense_advance_clearing_sequence : black, isort, prettier
Saran440 Oct 10, 2020
c4c889e
[13.0][MIG] hr_expense_advance_clearing_sequence
Saran440 Oct 11, 2020
986d439
[UPD] Update hr_expense_advance_clearing_sequence.pot
oca-travis May 15, 2021
3567e77
[14.0][MIG] hr_expense_advance_clearing_sequence
Saran440 May 16, 2021
3bd4aa7
[UPD] Update hr_expense_advance_clearing_sequence.pot
oca-travis Jun 15, 2022
e2d6540
[UPD] README.rst
OCA-git-bot Jun 15, 2022
01daf77
[MIG] hr_expense_advance_clearing_sequence: Migration to 15.0
Saran440 Mar 10, 2023
8356d4f
[UPD] Update hr_expense_advance_clearing_sequence.pot
May 18, 2023
31daab7
[UPD] README.rst
OCA-git-bot May 18, 2023
6e8c714
Added translation using Weblate (Italian)
mymage Jun 28, 2023
61350c5
Translated using Weblate (Italian)
mymage Jun 28, 2023
17d9c7e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
189ef65
[MIG] hr_expense_advance_clearing_sequence: Migration to 16.0
Saran440 May 30, 2024
990be52
[UPD] Update hr_expense_advance_clearing_sequence.pot
Sep 4, 2024
d2a0c93
[BOT] post-merge updates
OCA-git-bot Sep 4, 2024
bb04b71
[IMP] hr_expense_advance_clearing_sequence: pre-commit auto fixes
Saran440 Jan 17, 2025
eefc598
[MIG] hr_expense_advance_clearing_sequence: Migration to 18.0
Saran440 Jan 17, 2025
874c453
[UPD] Update hr_expense_advance_clearing_sequence.pot
Apr 22, 2025
e23e5ce
[BOT] post-merge updates
OCA-git-bot Apr 22, 2025
43d7d02
[IMP] hr_expense_advance_clearing_sequence: pre-commit auto fixes
dnplkndll May 28, 2026
c4cff30
[MIG] hr_expense_advance_clearing_sequence: Migration to 19.0
dnplkndll May 28, 2026
611223e
[DO NOT MERGE] hr_expense_advance_clearing_sequence: pin hr_expense_s…
dnplkndll May 28, 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
112 changes: 112 additions & 0 deletions hr_expense_advance_clearing_sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================================
HR Expense Advance Clearing Sequence
====================================

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

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

Adds a dedicated sequence for **advance** ``hr.expense`` records (those
with ``expense_type='advance'``). When an advance is created, its
``number`` field — added by ``hr_expense_sequence`` — is populated from
the ``hr.expense.advance`` sequence (prefix ``AV`` by default) instead
of the generic ``hr.expense`` sequence used for regular expenses.

19.0 note: 18.0 keyed the sequence off the sheet-level ``advance`` flag
(sequence code ``hr.expense.sheet.advance``). The 19.0 redesign moves
the flag to per-expense ``expense_type``, so the sequence code is now
``hr.expense.advance`` and lives on ``hr.expense.create`` instead of
``hr.expense.sheet.create``.

**Table of contents**

.. contents::
:local:

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

You can change the default sequence (EXAV0001) by the one of your choice
going to *Settings > Technical > Sequences & Identifiers > Sequences*,
and editing the record Expense report sequence (Advance).

You will only have access to that section if your section has Technical
features permission check marked.

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_sequence%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
------------

- Pimolnat Suntian <pimolnats@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-ps-tubtim| image:: https://github.com/ps-tubtim.png?size=40px
:target: https://github.com/ps-tubtim
:alt: ps-tubtim
.. |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-ps-tubtim| |maintainer-dnplkndll|

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

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

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

{
"name": "HR Expense Advance Clearing Sequence",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"category": "Human Resources",
"author": "Ecosoft, Odoo Community Association (OCA)",
"maintainers": ["ps-tubtim", "dnplkndll"],
"website": "https://github.com/OCA/hr-expense",
"depends": ["hr_expense_sequence", "hr_expense_advance_clearing"],
"data": ["data/hr_expense_data.xml"],
"installable": True,
}
10 changes: 10 additions & 0 deletions hr_expense_advance_clearing_sequence/data/hr_expense_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="seq_expense_advance" model="ir.sequence">
<field name="name">Employee Advance sequence</field>
<field name="code">hr.expense.advance</field>
<field name="padding" eval="4" />
<field name="prefix">AV</field>
<field name="company_id" eval="False" />
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_advance_clearing_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_expense_advance_clearing_sequence
#: model:ir.model,name:hr_expense_advance_clearing_sequence.model_hr_expense_sheet
msgid "Expense Report"
msgstr ""
22 changes: 22 additions & 0 deletions hr_expense_advance_clearing_sequence/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_advance_clearing_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-28 17:08+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: hr_expense_advance_clearing_sequence
#: model:ir.model,name:hr_expense_advance_clearing_sequence.model_hr_expense_sheet
msgid "Expense Report"
msgstr "Nota spese"
3 changes: 3 additions & 0 deletions hr_expense_advance_clearing_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

from . import hr_expense
18 changes: 18 additions & 0 deletions hr_expense_advance_clearing_sequence/models/hr_expense.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# Copyright 2026 Ledo <https://ledoweb.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

from odoo import api, models


class HrExpense(models.Model):
_inherit = "hr.expense"

@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if vals.get("expense_type") == "advance" and vals.get("number", "/") == "/":
vals["number"] = (
self.env["ir.sequence"].next_by_code("hr.expense.advance") or "/"
)
return super().create(vals_list)
3 changes: 3 additions & 0 deletions hr_expense_advance_clearing_sequence/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions hr_expense_advance_clearing_sequence/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You can change the default sequence (EXAV0001) by the one of your choice
going to *Settings \> Technical \> Sequences & Identifiers \>
Sequences*, and editing the record Expense report sequence (Advance).

You will only have access to that section if your section has Technical
features permission check marked.
2 changes: 2 additions & 0 deletions hr_expense_advance_clearing_sequence/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Pimolnat Suntian \<<pimolnats@ecosoft.co.th>\>
- Saran Lim. \<<saranl@ecosoft.co.th>\>
11 changes: 11 additions & 0 deletions hr_expense_advance_clearing_sequence/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Adds a dedicated sequence for **advance** `hr.expense` records (those
with `expense_type='advance'`). When an advance is created, its `number`
field — added by `hr_expense_sequence` — is populated from the
`hr.expense.advance` sequence (prefix `AV` by default) instead of the
generic `hr.expense` sequence used for regular expenses.

19.0 note: 18.0 keyed the sequence off the sheet-level `advance` flag
(sequence code `hr.expense.sheet.advance`). The 19.0 redesign moves the
flag to per-expense `expense_type`, so the sequence code is now
`hr.expense.advance` and lives on `hr.expense.create` instead of
`hr.expense.sheet.create`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading