Martin Maes 562114c532 [FIX] mrp: remove microseconds on timesheets
**Sum of timesheets time different than what the timer displays**

Steps to reproduce:

 1. Start a workorder timesheet, then stop it
 2. Repeat the process multiple times.

Current behavior:

The error is based on a microsecond precision so you could need
to try multiple times before reaching the problem.

 - The time displayed on the timer widget does not display the same as
the sum in the timesheet list.
 - The difference between the start date and end date of a timesheet
is not always equal to its duration.

Expected behavior:

 - The sum of duration should be the same as the one displayed on the
timer widget.
 - The difference between the start and end date of a timesheet
should be equal to it's duration.

The computation of the duration of a timesheet will take microseconds
into account. It's not useful in the timsheets to save microseconds
as the precision is too high and as the user cannot change it manually
anyway.

Removing this precision (i.e. setting microseconds to 0) solve this
problem as it does not trigger rounding errors in a single timesheet
and thus in the total computation of duration of a workorder.

Also, there was a precision rounding error on the timer widget.
Time is saved as minutes in db, and displayed as seconds.
So 2s is 1/30 of min => 0,0333... min.
As multiplying this by 60 will return 1,99999 and as the timer was flooring the result,
there was some difference between the time recorded and the value displayed in the
widget.

enterprise : https://github.com/odoo/enterprise/pull/41727
opw-3241156

closes odoo/odoo#130618

X-original-commit: 0172395fa60c94150609bbbfe174d5eee44525fe
Related: odoo/enterprise#45109
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-08-03 10:43:49 +02:00
…
2023-08-02 05:10:21 +02:00
2023-08-02 17:29:27 +02:00
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%