Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
99 changes: 99 additions & 0 deletions hr_expense_duplicate_disable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
=========================
Expense Duplicate Disable
=========================

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

.. |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/licence-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/18.0/hr_expense_duplicate_disable
: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-18-0/hr-expense-18-0-hr_expense_duplicate_disable
: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=18.0
:alt: Try me on Runboat

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

This module allows to disable the duplicate expense detection in
hr.expense.

When enabled, it will skip computing duplicate expense warnings,
improving performance for large expense datasets where duplicate
detection is not needed.

**Table of contents**

.. contents::
:local:

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

To disable the duplicate expense detection:

#. Go to Expenses > Configuration > Settings. #. Check **Duplicate
Detection** and Save.

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_duplicate_disable%0Aversion:%2018.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
------------

- `Ecosoft <https://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-Saran440| image:: https://github.com/Saran440.png?size=40px
:target: https://github.com/Saran440
:alt: Saran440

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

|maintainer-Saran440|

This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/18.0/hr_expense_duplicate_disable>`_ 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_duplicate_disable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions hr_expense_duplicate_disable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2026 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Expense Duplicate Disable",
"summary": "Allow to disable duplicate expense detection",
"version": "18.0.1.0.0",
"category": "Human Resources",
"author": "Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/hr-expense",
"depends": ["hr_expense"],
"license": "AGPL-3",
"data": [
"views/res_config_settings_view.xml",
],
"installable": True,
"maintainers": ["Saran440"],
}
4 changes: 4 additions & 0 deletions hr_expense_duplicate_disable/models/__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 res_config_settings
from . import hr_expense
19 changes: 19 additions & 0 deletions hr_expense_duplicate_disable/models/hr_expense.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import Command, api, models
from odoo.tools import str2bool


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

@api.depends("employee_id", "product_id", "total_amount_currency")
def _compute_duplicate_expense_ids(self):
if not str2bool(
self.env["ir.config_parameter"]
.sudo()
.get_param("hr_expense_disable_duplicate_detection", "False")
):
return super()._compute_duplicate_expense_ids()
self.duplicate_expense_ids = [Command.clear()]
14 changes: 14 additions & 0 deletions hr_expense_duplicate_disable/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2026 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

hr_expense_disable_duplicate_detection = fields.Boolean(
string="Disable duplicate expense detection",
config_parameter="hr_expense_disable_duplicate_detection",
help="If enabled, the system will not warn about duplicate expenses.",
)
3 changes: 3 additions & 0 deletions hr_expense_duplicate_disable/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions hr_expense_duplicate_disable/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To disable the duplicate expense detection:

#. Go to Expenses > Configuration > Settings.
#. Check **Duplicate Detection** and Save.
2 changes: 2 additions & 0 deletions hr_expense_duplicate_disable/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Ecosoft](<https://ecosoft.co.th>):
- Saran Lim. \<<saranl@ecosoft.co.th>\>
4 changes: 4 additions & 0 deletions hr_expense_duplicate_disable/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module allows to disable the duplicate expense detection in hr.expense.

When enabled, it will skip computing duplicate expense warnings, improving performance
for large expense datasets where duplicate detection is not needed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading