Skip to content
Snippets Groups Projects
Commit d9ed98f5 authored by Yoshi Tashiro's avatar Yoshi Tashiro Committed by Touati Djamel (otd)
Browse files

[FIX] stock: allow creating a scrap with more than 2 decimals in qty


scrap_qty field was missing the digits attribute, and therefore the user
could not create a scrap with a quantity with more than two decimal places.
With this commit, scrap_qty will follow the 'Product Unit of Measure'
precision setting, just like any other quantity fields.

closes odoo/odoo#78220

X-original-commit: 14322fc4
Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
parent 09264e2e
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ class StockScrap(models.Model):
scrap_location_id = fields.Many2one(
'stock.location', 'Scrap Location', default=_get_default_scrap_location_id,
domain="[('scrap_location', '=', True), ('company_id', 'in', [company_id, False])]", required=True, states={'done': [('readonly', True)]}, check_company=True)
scrap_qty = fields.Float('Quantity', default=1.0, required=True, states={'done': [('readonly', True)]})
scrap_qty = fields.Float('Quantity', default=1.0, required=True, states={'done': [('readonly', True)]}, digits='Product Unit of Measure')
state = fields.Selection([
('draft', 'Draft'),
('done', 'Done')],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment