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
117 changes: 117 additions & 0 deletions hr_timesheet_amount_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============================
HR Timesheet Amount Security
============================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/19.0/hr_timesheet_amount_security
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-19-0/timesheet-19-0-hr_timesheet_amount_security
: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/timesheet&target_branch=19.0
:alt: Try me on Runboat

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

This module adds security restrictions to timesheet amount fields.

It restricts access to cost-related fields in timesheet reports to users
who have the "Allow to read analytic costs" permission from the
```analytic_amount_security`` <https://github.com/OCA/account-analytic/tree/18.0/analytic_amount_security>`__
module.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

This module addresses the need to control which users can view cost
information in timesheet reports. In many organizations, regular
employees should be able to see time tracking information but not the
monetary costs associated with that time.

The module leverages the ``group_allow_read_analytic_amount`` group from
the
```analytic_amount_security`` <https://github.com/OCA/account-analytic/tree/18.0/analytic_amount_security>`__
module to restrict access to:

- Amount field in Timesheets Analysis Report
- Cost fields in Timesheet Attendance Report (timesheets_cost,
attendance_cost, cost_difference)

This allows for fine-grained control over financial data visibility
while maintaining transparency for time tracking.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/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/timesheet/issues/new?body=module:%20hr_timesheet_amount_security%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
-------

* Moduon

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

- Emilio Pascual emilio.pascual@moduon.team
- Rafael Blasco rafael.bn@moduon.team

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-EmilioPascual| image:: https://github.com/EmilioPascual.png?size=40px
:target: https://github.com/EmilioPascual
:alt: EmilioPascual
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
:target: https://github.com/rafaelbn
:alt: rafaelbn

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

|maintainer-EmilioPascual| |maintainer-rafaelbn|

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/19.0/hr_timesheet_amount_security>`_ 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_timesheet_amount_security/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from . import models
21 changes: 21 additions & 0 deletions hr_timesheet_amount_security/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
{
"name": "HR Timesheet Amount Security",
"summary": "Add security restrictions to timesheet amount fields",
"version": "19.0.1.0.0",
"development_status": "Alpha",
"category": "Human Resources/Timesheets",
"website": "https://github.com/OCA/timesheet",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["EmilioPascual", "rafaelbn"],
"license": "LGPL-3",
"depends": [
"analytic_amount_security",
"hr_timesheet",
"hr_timesheet_attendance",
],
"data": [],
"auto_install": False,
"installable": True,
}
47 changes: 47 additions & 0 deletions hr_timesheet_amount_security/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of hr_timesheet_amount_security
# Copyright (C) 2025 Moduon Team S.L.
# This file is distributed under the same license as the hr_timesheet_amount_security package.
#
msgid ""
msgstr ""
"Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-05\n"
"PO-Revision-Date: 2025-05-05\n"
"Last-Translator: Emilio Pascual <emilio.pascual@moduon.team>\n"
"Language-Team: Spanish\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__attendance_cost
msgid "Attendance Cost"
msgstr "Coste de Asistencia"

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__cost_difference
msgid "Cost Difference"
msgstr "Diferencia de Coste"

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_timesheets_analysis_report__amount
msgid "Amount"
msgstr "Importe"

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__timesheets_cost
msgid "Timesheets Cost"
msgstr "Coste de Parts de Horas"

#. module: hr_timesheet_amount_security
#: model:ir.model,name:hr_timesheet_amount_security.model_hr_timesheet_attendance_report
msgid "Timesheet Attendance Report"
msgstr "Informe de Partes de Horas y Asistencia"

#. module: hr_timesheet_amount_security
#: model:ir.model,name:hr_timesheet_amount_security.model_timesheets_analysis_report
msgid "Timesheets Analysis Report"
msgstr "Informe de Análisis de Parts de Horas"
45 changes: 45 additions & 0 deletions hr_timesheet_amount_security/i18n/hr_timesheet_amount_security.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of hr_timesheet_amount_security
# Copyright (C) 2025 Moduon Team S.L.
# This file is distributed under the same license as the hr_timesheet_amount_security package.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 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_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__attendance_cost
msgid "Attendance Cost"
msgstr ""

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__cost_difference
msgid "Cost Difference"
msgstr ""

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_timesheets_analysis_report__amount
msgid "Amount"
msgstr ""

#. module: hr_timesheet_amount_security
#: model:ir.model.fields,field_description:hr_timesheet_amount_security.field_hr_timesheet_attendance_report__timesheets_cost
msgid "Timesheets Cost"
msgstr ""

#. module: hr_timesheet_amount_security
#: model:ir.model,name:hr_timesheet_amount_security.model_hr_timesheet_attendance_report
msgid "Timesheet Attendance Report"
msgstr ""

#. module: hr_timesheet_amount_security
#: model:ir.model,name:hr_timesheet_amount_security.model_timesheets_analysis_report
msgid "Timesheets Analysis Report"
msgstr ""
4 changes: 4 additions & 0 deletions hr_timesheet_amount_security/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from . import timesheets_analysis_report
from . import hr_timesheet_attendance_report
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models


class HrTimesheetAttendanceReport(models.Model):
_inherit = "hr.timesheet.attendance.report"

timesheets_cost = fields.Float(
groups="analytic_amount_security.group_allow_read_analytic_amount"
)
attendance_cost = fields.Float(
groups="analytic_amount_security.group_allow_read_analytic_amount"
)
cost_difference = fields.Float(
groups="analytic_amount_security.group_allow_read_analytic_amount"
)
11 changes: 11 additions & 0 deletions hr_timesheet_amount_security/models/timesheets_analysis_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models


class TimesheetsAnalysisReport(models.Model):
_inherit = "timesheets.analysis.report"

amount = fields.Monetary(
groups="analytic_amount_security.group_allow_read_analytic_amount"
)
3 changes: 3 additions & 0 deletions hr_timesheet_amount_security/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
14 changes: 14 additions & 0 deletions hr_timesheet_amount_security/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
This module addresses the need to control which users can view cost information
in timesheet reports. In many organizations, regular employees should be able to
see time tracking information but not the monetary costs associated with that time.

The module leverages the `group_allow_read_analytic_amount` group from the
[`analytic_amount_security`](https://github.com/OCA/account-analytic/tree/19.0/analytic_amount_security)
module to restrict access to:

- Amount field in Timesheets Analysis Report
- Cost fields in Timesheet Attendance Report (timesheets_cost, attendance_cost,
cost_difference)

This allows for fine-grained control over financial data visibility while
maintaining transparency for time tracking.
2 changes: 2 additions & 0 deletions hr_timesheet_amount_security/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Emilio Pascual <emilio.pascual@moduon.team>
* Rafael Blasco <rafael.bn@moduon.team>
6 changes: 6 additions & 0 deletions hr_timesheet_amount_security/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module adds security restrictions to timesheet amount fields.

It restricts access to cost-related fields in timesheet reports to users who have
the "Allow to read analytic costs" permission from the
[`analytic_amount_security`](https://github.com/OCA/account-analytic/tree/18.0/analytic_amount_security)
module.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading