[FIX] sale: timesheet in hours
- Create a SO - Add a product service that will generate a task to the confirmation. Its UOM must be Hour(s) - Confirm the so an go into the task - Add a timesheet line with "00h20min" and save it Quantity saved into the delivery qty of the SO is 0.34 instead of 0.33. The default rounding method is `UP`, so we use `HALF-UP` instead. opw-1975014 closes odoo/odoo#33276 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -34,7 +34,7 @@ class SaleOrderLine(models.Model):
|
||||
lines.setdefault(line, 0.0)
|
||||
uom = self.env['product.uom'].browse(d['product_uom_id'][0])
|
||||
if line.product_uom.category_id == uom.category_id:
|
||||
qty = uom._compute_quantity(d['unit_amount'], line.product_uom)
|
||||
qty = uom._compute_quantity(d['unit_amount'], line.product_uom, rounding_method='HALF-UP')
|
||||
else:
|
||||
qty = d['unit_amount']
|
||||
lines[line] += qty
|
||||
|
||||
Reference in New Issue
Block a user