Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e99151f
Add sale_timesheet_rounded
simahawk May 15, 2019
c38223f
[IMP] sale_timesheet_rounded: black, isort, prettier
May 21, 2020
1e54434
[MIG] sale_timesheet_rounded: Migration to 13.0
May 21, 2020
8efd564
[IMP] sale_timesheet_rounded: Convert it to computed writeable
pedrobaeza Jun 4, 2020
0fc8bff
[IMP] sale_timesheet_rounded: black, isort, prettier
fshah-initos Mar 11, 2021
c527a0a
[14.0][MIG]sale_timesheet_rounded
fshah-initos Mar 11, 2021
435ef21
12.0 - sale_timesheet_rounded
enriquemartin Jun 23, 2020
8c94416
sale_timesheet_rounded 14.0.1.0.1
OCA-git-bot Mar 11, 2022
6bf62fb
[FIX] sale_timesheet_round: test need an install decorator
May 3, 2022
0261111
[15.0] MIG sale_timesheet_rounding: Migration to 15.0
Jun 22, 2022
3fbdd7e
[15.0] MIG sale_timesheet_rounding: Fixing precommit error
Jun 22, 2022
2e8129f
[15.0][FIX] sale_timesheet_rounded: avoid recomputing rounded amounts…
Jun 7, 2023
5f8d756
[16.0][MIG] sale_timesheet_rounded: Migration to 16.0
hoangphuc1410 Jul 20, 2023
2410575
[IMP] sale_timesheet_rounded: pre-commit auto fixes
Mar 7, 2024
adf7ddb
[MIG] sale_timesheet_rounded: Migration to 17.0
Mar 8, 2024
c31dbf1
[UPD] Update sale_timesheet_rounded.pot
Jun 26, 2024
810e7d7
Update translation files
weblate Jul 30, 2024
92b948b
Translated using Weblate (Italian)
mymage Jul 31, 2024
85f8ef0
Translated using Weblate (Italian)
mymage Oct 1, 2025
5528161
[MIG] sale_timesheet_rounded: Migration to 18.0
MVillaescusaM Nov 27, 2025
c55c797
[UPD] Update sale_timesheet_rounded.pot
Feb 28, 2026
629ff7b
[BOT] post-merge updates
OCA-git-bot Feb 28, 2026
ed7f26a
Translated using Weblate (Spanish)
Ed-Spain Apr 16, 2026
d3e354e
Translated using Weblate (Spanish)
Ed-Spain May 10, 2026
9d221d4
[MIG] sale_timesheet_rounded : Migration to 19.0.
uncannycs May 14, 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
140 changes: 140 additions & 0 deletions sale_timesheet_rounded/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Sale Timesheet Rounded
======================

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

.. |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/sale_timesheet_rounded
: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-sale_timesheet_rounded
: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|

Round timesheet lines amounts in sales based on project' settings.

A typical use case is: you work 5 minutes but you want to invoice 15
minutes.

With this module you can configure a rounding unit or factor on the
project and all the lines tracked on this project's tasks will show a
rounded amount.

If you want you can override the value manually on each entry.

The delivered quantity on the sale order line - and by consequence on
the invoice - will be computed using the rounded amount. Therefore,
expense lines and other non-timesheet lines will be updated with a
rounded amount that is equal to the amount.

WARNING: This module cannot be used with timesheet_grid without further
adapation as an update of an existing timesheet line will NOT update the
rounded amount. To achieve this, you need to override adjust_grid
function to pass the force_compute context key.

**Table of contents**

.. contents::
:local:

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

Go to a project and set the following fields according to your needs:

- Timesheet rounding unit

Defines the rounding unit. For instance, if you want to round to 1 hour,
you can set 1.0. If you want to round to 15 min set 0.25.

- Timesheet rounding method

Options: "No" (default), "Closest", "Up", "Down".

Please refer to odoo.tools.float_utils.float_round to understand the
difference.

- Timesheet rounding factor (percentage)

When round unit is not defined you can round by a fixed %.

When using both a unit and a factor, the factor will be applied first:

result = round(amount \* percentage, unit)

Known issues / Roadmap
======================

- improve test coverage

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:%20sale_timesheet_rounded%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
-------

* Camptocamp

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

- Simone Orsi <simone.orsi@camptocamp.com>
- Thomas Nowicki <thomas.nowicki@camptocamp.com>
- Akim Juillerat <akim.juillerat@camptocamp.com>
- Foram Shah <foram.shah@initos.com>
- Phuc Kieu <phuckh@trobz.com>
- Son Ho <sonhd@trobz.com>

Other credits
-------------

The migration of this sale_timesheet_rounded from 16.0 to 17.0 was
financially supported by Camptocamp

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.

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/19.0/sale_timesheet_rounded>`_ 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 sale_timesheet_rounded/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from .hooks import pre_init_hook
from . import wizard
21 changes: 21 additions & 0 deletions sale_timesheet_rounded/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2019 Camptocamp SA
# Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Sale Timesheet Rounded",
"summary": "Round timesheet entries amount based on project settings.",
"version": "19.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Sales",
"website": "https://github.com/OCA/timesheet",
"depends": ["project", "hr_timesheet", "sale_timesheet"],
"data": [
# Views
"views/account_analytic_line.xml",
"views/project_project.xml",
"views/project_task.xml",
],
"installable": True,
"pre_init_hook": "pre_init_hook",
}
28 changes: 28 additions & 0 deletions sale_timesheet_rounded/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 Camptocamp SA
# Copyright 2020 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)

import logging

from psycopg2 import sql

_logger = logging.getLogger(__name__)


def pre_init_hook(env):
"""Initialize the value of the given column for existing rows in a fast way."""
_logger.info(
"Initializing column `unit_amount_rounded` with the value of `unit_amount`"
)
table = sql.Identifier("account_analytic_line")
column = sql.Identifier("unit_amount_rounded")
env.cr.execute( # pylint: disable=E8103
sql.SQL("ALTER TABLE {} ADD COLUMN IF NOT EXISTS {} NUMERIC").format(
table, column
)
)
env.cr.execute( # pylint: disable=E8103
sql.SQL(
"UPDATE {table} SET {column} = unit_amount WHERE {column} IS NULL"
).format(table=table, column=column)
)
151 changes: 151 additions & 0 deletions sale_timesheet_rounded/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_timesheet_rounded
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-09-26 14:24+0000\n"
"Last-Translator: Akim Juillerat <akim.juillerat@camptocamp.com>\n"
"Language-Team: none\n"
"Language: de\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 3.8\n"

#. module: sale_timesheet_rounded
#: model:ir.model.fields,help:sale_timesheet_rounded.field_project_project__timesheet_rounding_unit
msgid ""
"1.0 = hour\n"
" 0.25 = 15 min\n"
" 0.084 ~= 5 min\n"
" 0.017 ~= 1 min\n"
" "
msgstr ""
"1.0 = Stunde\n"
" 0.25 = 15 Min\n"
" 0.084 ~= 5 Min\n"
" 0.017 ~= 1 Min\n"
" "

#. module: sale_timesheet_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.account_analytic_line_kanban_inherit
#, fuzzy
msgid ""
"<br/>\n"
" <strong>Rounded: </strong>"
msgstr ""
"<br/>\n"
" <strong>Gerundet: </strong>"

#. module: sale_timesheet_rounded
#: model:ir.model,name:sale_timesheet_rounded.model_account_analytic_line
msgid "Analytic Line"
msgstr "Kostenstellen Buchung"

#. module: sale_timesheet_rounded
#: model:ir.model.fields.selection,name:sale_timesheet_rounded.selection__project_project__timesheet_rounding_method__half_up
msgid "Closest"
msgstr "Am nächsten"

#. module: sale_timesheet_rounded
#: model:ir.model.fields.selection,name:sale_timesheet_rounded.selection__project_project__timesheet_rounding_method__down
msgid "Down"
msgstr "Nach unten"

#. module: sale_timesheet_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.hr_timesheet_view_task_form2_inherited_inherit
msgid "Duration (rounded)"
msgstr "Geleistete Stunden (gerundet)"

#. module: sale_timesheet_rounded
#: model:ir.model.fields,help:sale_timesheet_rounded.field_project_project__timesheet_rounding_method
msgid ""
"If you activate the rounding of timesheet lines, only new entries will be "
"rounded (i.e. existing lines will not be rounded automatically)."
msgstr ""
"Wenn Sie die Rundung von Zeiterfassungszeilen aktivieren, werden nur neue "
"Einträge gerundet (d.h. bestehende Zeilen werden nicht automatisch gerundet)."

#. module: sale_timesheet_rounded
#: model:ir.model,name:sale_timesheet_rounded.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: sale_timesheet_rounded
#: model:ir.model.fields.selection,name:sale_timesheet_rounded.selection__project_project__timesheet_rounding_method__no
msgid "No rounding"
msgstr "Keine Rundung"

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

#. module: sale_timesheet_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.view_account_analytic_line_form_inherit
msgid "Quantity Rounded"
msgstr "Gerundete Menge"

#. module: sale_timesheet_rounded
#: model:ir.model.fields,field_description:sale_timesheet_rounded.field_account_analytic_line__unit_amount_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.account_analytic_line_tree_inherit
msgid "Quantity rounded"
msgstr "Gerundete Menge"

#. module: sale_timesheet_rounded
#: model:ir.model.fields,field_description:sale_timesheet_rounded.field_project_project__timesheet_rounding_unit
msgid "Rounding Unit"
msgstr ""

#. module: sale_timesheet_rounded
#: model:ir.model.fields,field_description:sale_timesheet_rounded.field_project_project__timesheet_rounding_method
msgid "Rounding method"
msgstr ""

#. module: sale_timesheet_rounded
#: model:ir.model,name:sale_timesheet_rounded.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""

#. module: sale_timesheet_rounded
#: model:ir.model,name:sale_timesheet_rounded.model_sale_order_line
msgid "Sales Order Line"
msgstr "Auftragzeile"

#. module: sale_timesheet_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.project_project_form_inherit
msgid "Time rounding"
msgstr "Zeit Rundung"

#. module: sale_timesheet_rounded
#: model:ir.model.fields,field_description:sale_timesheet_rounded.field_project_project__timesheet_rounding_factor
msgid "Timesheet rounding factor in percentage"
msgstr "Stundenzettel Rundungsfaktor (in Prozent)"

#. module: sale_timesheet_rounded
#: model:ir.model.constraint,message:sale_timesheet_rounded.constraint_project_project_check_timesheet_rounding_factor
msgid ""
"Timesheet rounding factor should stay between 0 and 500, endpoints included."
msgstr ""
"Der Stundezettel Rundungsfaktor muss inzwischen 0 und 500 sein, Endpunkte "
"inklusive."

#. module: sale_timesheet_rounded
#: model_terms:ir.ui.view,arch_db:sale_timesheet_rounded.account_analytic_line_tree_inherit
msgid "Total quantity rounded"
msgstr "Total gerundete Menge"

#. module: sale_timesheet_rounded
#: model:ir.model.fields.selection,name:sale_timesheet_rounded.selection__project_project__timesheet_rounding_method__up
msgid "Up"
msgstr "Nach oben"

#~ msgid "Timesheet rounding method"
#~ msgstr "Stundenzettel Rundungsmethode"

#~ msgid "Timesheet rounding unit"
#~ msgstr "Stundenzettel Rundungseinheit"
Loading
Loading