diff options
| author | Jorge Pinna Puissant <jpp@odoo.com> | 2020-08-06 07:06:55 +0000 |
|---|---|---|
| committer | Jorge Pinna Puissant <jpp@odoo.com> | 2020-08-06 11:00:12 +0000 |
| commit | 09bfca4d0c9bdbdd4b93d8f982a9b7d06528fdf8 (patch) | |
| tree | 4a9cd067b5740d4c0ec2ed9343721d776eab6617 /addons | |
| parent | 7e8a1f7a0693c6b6af7b075b5bbae1f02a48c259 (diff) | |
[FIX] hr_timesheet: wrong uom factor in widget
- Install hr_timesheet and sales;
- Create a product, set it as a service product with units of
measurement in days.
- Set the product as a task will be created from SO;
- Add a timesheet for one day to a task in a project (8 hours for
instance);
- The smart button on the sales order shows the time logged for that
project.
Before this commit, when the timesheet encoding unit is 'Hours', the
smart button shows the correct logged time (8 hours). But, when the
timesheet encoding unit is changed to 'Days', the samrt button shows
0.125 Days instead of 1 Day. This occurs because the uom used to create
the uom factor for the widget is not the Timesheet encoding unit.
opw-2301510
closes odoo/odoo#55544
X-original-commit: 2a7ec79c6a4563b608a4525ebccdea5978799caa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/hr_timesheet/models/ir_http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/hr_timesheet/models/ir_http.py b/addons/hr_timesheet/models/ir_http.py index 51e929b62af..940a55a5369 100644 --- a/addons/hr_timesheet/models/ir_http.py +++ b/addons/hr_timesheet/models/ir_http.py @@ -17,5 +17,5 @@ class Http(models.AbstractModel): encoding_uom = company.timesheet_encode_uom_id result['timesheet_uom'] = encoding_uom.read(['name', 'rounding', 'timesheet_widget'])[0] - result['timesheet_uom_factor'] = company.project_time_mode_id._compute_quantity(1.0, encoding_uom, round=False) # convert encoding uom into stored uom to get conversion factor + result['timesheet_uom_factor'] = company.timesheet_encode_uom_id._compute_quantity(1.0, encoding_uom, round=False) # convert encoding uom into stored uom to get conversion factor return result |
