Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
101f3c2
[16.0][ADD] hr_timesheet_type_non_billable: New module hr_timesheet_t…
mpascuall Apr 3, 2025
be8a8ed
[UPD] Update hr_timesheet_type_non_billable.pot
Apr 14, 2025
eb38ee6
[BOT] post-merge updates
OCA-git-bot Apr 14, 2025
c7c04b7
[IMP] hr_timesheet_type_non_billable: pre-commit auto fixes
mpascuall Apr 14, 2025
215a121
[MIG] hr_timesheet_type_non_billable: Migration to 17.0
mpascuall Apr 14, 2025
651a79d
[UPD] Update hr_timesheet_type_non_billable.pot
Apr 24, 2025
8d1eb69
[BOT] post-merge updates
OCA-git-bot Apr 24, 2025
2aaecc1
Added translation using Weblate (Italian)
mymage Apr 28, 2025
56528b3
Translated using Weblate (Italian)
mymage May 3, 2025
3a251dd
[IMP] hr_timesheet_type_non_billable: Now works with helpdesk_ticket too
mpascuall Jun 12, 2025
c454216
[UPD] Update hr_timesheet_type_non_billable.pot
Jun 17, 2025
b7ba1ac
[BOT] post-merge updates
OCA-git-bot Jun 17, 2025
2d90381
Update translation files
weblate Jun 17, 2025
22a9506
Translated using Weblate (Italian)
mymage Jun 17, 2025
e31bfaf
[17.0][FIX] hr_timesheet_type_non_billable: Fixed dependencies
mpascuall Jul 30, 2025
0807bd1
[UPD] Update hr_timesheet_type_non_billable.pot
Jul 30, 2025
9c67d39
[BOT] post-merge updates
OCA-git-bot Jul 30, 2025
1e79738
Update translation files
weblate Jul 30, 2025
ad87e01
[MIG] hr_timesheet_type_non_billable: Migration to 18.0
lbarry-apsl Mar 4, 2026
7a50a73
[UPD] Update hr_timesheet_type_non_billable.pot
Apr 15, 2026
35110f5
[BOT] post-merge updates
OCA-git-bot Apr 15, 2026
7abee27
[MIG] hr_timesheet_type_non_billable: Migration to 19.0
BhaveshHeliconia May 20, 2026
dfa856b
[DON'T MERGE] test-requirements.txt
BhaveshHeliconia May 20, 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
106 changes: 106 additions & 0 deletions hr_timesheet_type_non_billable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==============================
HR Timesheet Type Non Billable
==============================

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

.. |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%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/19.0/hr_timesheet_type_non_billable
: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_type_non_billable
: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|

Sometimes you want to add timesheets that are not billable to clients.
With this module you can configure which timesheet type are not billable
so every timesheet with this type won't affect to project and task
remaining time computation.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Go to Project > Configuration > Time Type
2. Create or edit a Time Type and mark it as Non Billable
3. Go to a project and select a task
4. Add planned hours to the task
5. Create a new timesheet with the Time Type you just created
6. You will see that the time you entered on the timesheet is not
discounted on the remaining hours or added in effective hours
7. You can also see project remaining hours are not affected by this non
billable time

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

* APSL-Nagarro

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

[APSL-Nagarro](https://apsl.tech):

- Miquel Pascual López <mpascual@apsl.net>

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

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

|maintainer-mpascuall|

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/19.0/hr_timesheet_type_non_billable>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_timesheet_type_non_billable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions hr_timesheet_type_non_billable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 Miquel Pascual López(APSL-Nagarro)<mpascual@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "HR Timesheet Type Non Billable",
"version": "19.0.1.0.0",
"category": "Timesheet",
"website": "https://github.com/OCA/timesheet",
"author": "APSL-Nagarro, Odoo Community Association (OCA)",
"maintainers": ["mpascuall"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"hr_timesheet",
"hr_timesheet_time_type",
"sale_timesheet_line_exclude",
],
"data": [
"views/project_time_type_view.xml",
],
}
43 changes: 43 additions & 0 deletions hr_timesheet_type_non_billable/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_type_non_billable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-03 12:08+0000\n"
"PO-Revision-Date: 2025-04-03 12:08+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_account_analytic_line
msgid "Analytic Line"
msgstr "Línia analítica"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_time_type
msgid "Define Time Types"
msgstr "Definir ipus de temps"

#. module: hr_timesheet_type_non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_account_analytic_line__non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_project_time_type__non_billable
msgid "Non Billable"
msgstr "No Facturable"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_project
msgid "Project"
msgstr "Projecte"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_task
msgid "Task"
msgstr "Tasca"
43 changes: 43 additions & 0 deletions hr_timesheet_type_non_billable/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_type_non_billable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-03 12:09+0000\n"
"PO-Revision-Date: 2025-04-03 12:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_account_analytic_line
msgid "Analytic Line"
msgstr "Línea analítica"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_time_type
msgid "Define Time Types"
msgstr "Definir tipos de tiempo"

#. module: hr_timesheet_type_non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_account_analytic_line__non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_project_time_type__non_billable
msgid "Non Billable"
msgstr "No Facturable"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_project
msgid "Project"
msgstr "Proyecto"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_task
msgid "Task"
msgstr "Tarea"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_type_non_billable
#
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_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_account_analytic_line
msgid "Analytic Line"
msgstr ""

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_time_type
msgid "Define Time Types"
msgstr ""

#. module: hr_timesheet_type_non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_account_analytic_line__non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_project_time_type__non_billable
msgid "Non Billable"
msgstr ""

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_project
msgid "Project"
msgstr ""

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_task
msgid "Task"
msgstr ""
46 changes: 46 additions & 0 deletions hr_timesheet_type_non_billable/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_type_non_billable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-06-17 08:26+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 5.10.4\n"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_account_analytic_line
msgid "Analytic Line"
msgstr "Riga analitica"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_time_type
msgid "Define Time Types"
msgstr "Definizione tipi orario"

#. module: hr_timesheet_type_non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_account_analytic_line__non_billable
#: model:ir.model.fields,field_description:hr_timesheet_type_non_billable.field_project_time_type__non_billable
msgid "Non Billable"
msgstr "Non fatturabile"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_project
msgid "Project"
msgstr "Progetto"

#. module: hr_timesheet_type_non_billable
#: model:ir.model,name:hr_timesheet_type_non_billable.model_project_task
msgid "Task"
msgstr "Lavoro"

#~ msgid "Helpdesk Ticket"
#~ msgstr "Ticket assistenza clienti"
7 changes: 7 additions & 0 deletions hr_timesheet_type_non_billable/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2025 Miquel Pascual López(APSL-Nagarro)<mpascual@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import project_time_type
from . import account_analytic_line
from . import project_project
from . import project_task
20 changes: 20 additions & 0 deletions hr_timesheet_type_non_billable/models/account_analytic_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 Miquel Pascual López(APSL-Nagarro)<mpascual@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class AnalyticLine(models.Model):
_inherit = "account.analytic.line"

non_billable = fields.Boolean(
related="time_type_id.non_billable", string="Non Billable", readonly=True
)

@api.onchange("time_type_id")
def _onchange_time_type_id_non_billable(self):
for line in self:
if line.time_type_id and line.time_type_id.non_billable:
line.exclude_from_sale_order = True
else:
line.exclude_from_sale_order = False
30 changes: 30 additions & 0 deletions hr_timesheet_type_non_billable/models/project_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2025 Miquel Pascual López(APSL-Nagarro)<mpascual@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models
from odoo.fields import Domain


class Project(models.Model):
_inherit = "project.project"

@api.depends("allow_timesheets", "timesheet_ids")
def _compute_remaining_hours(self):
res = super()._compute_remaining_hours()

timesheets_read_group = self.env["account.analytic.line"]._read_group(
Domain([("project_id", "in", self.ids), ("non_billable", "=", False)]),
["project_id"],
["unit_amount:sum"],
)
Comment thread
BhaveshHeliconia marked this conversation as resolved.
timesheet_time_dict = {
project.id: unit_amount_sum
for project, unit_amount_sum in timesheets_read_group
}
for project in self:
project.remaining_hours = project.allocated_hours - timesheet_time_dict.get(
project.id, 0
)
project.is_project_overtime = project.remaining_hours < 0

return res
22 changes: 22 additions & 0 deletions hr_timesheet_type_non_billable/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 Miquel Pascual López(APSL-Nagarro)<mpascual@apsl.net>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class ProjectTask(models.Model):
_inherit = "project.task"

@api.depends("timesheet_ids.unit_amount")
def _compute_effective_hours(self):
res = super()._compute_effective_hours()

for task in self:
non_billable_hours = sum(
timesheet.unit_amount
for timesheet in task.timesheet_ids
if timesheet.non_billable
)
task.effective_hours -= non_billable_hours

return res
Loading
Loading