diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 63412a40136..2694989372b 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -203,7 +203,7 @@ class ProductProduct(models.Model): fifo_vals = self._run_fifo(abs(quantity), company) vals['remaining_qty'] = fifo_vals.get('remaining_qty') # In case of AVCO, fix rounding issue of standard price when needed. - if self.cost_method == 'average': + if self.product_tmpl_id.cost_method == 'average': rounding_error = currency.round(self.standard_price * self.quantity_svl - self.value_svl) if rounding_error: # If it is bigger than the (smallest number of the currency * quantity) / 2, @@ -215,7 +215,7 @@ class ProductProduct(models.Model): float_repr(rounding_error, precision_digits=currency.decimal_places), currency.symbol ) - if self.cost_method == 'fifo': + if self.product_tmpl_id.cost_method == 'fifo': vals.update(fifo_vals) return vals