diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 5ab32db789a..a81b0260253 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -3,6 +3,7 @@ from odoo import api, fields, models, tools, _ from odoo.exceptions import UserError +from odoo.tools import float_is_zero class ProductTemplate(models.Model): @@ -105,7 +106,7 @@ class ProductProduct(models.Model): for location in locations: for product in self.with_context(location=location.id, compute_child=False): diff = product.standard_price - new_price - if diff: + if float_is_zero(diff, precision_rounding=product.currency_id.rounding): raise UserError(_("No difference between standard price and new price!")) if not product_accounts[product.id].get('stock_valuation', False): raise UserError(_('You don\'t have any stock valuation account defined on your product category. You must define one before processing this operation.'))