[FIX] product: Inventory at Date does not show the correct valuation

Fine tuning of this commit: 51d072db44

When clicking on the group of the Inventory at Date, the
product.price.inventory must follow the same order as the
read_group in stock.history.

opw:747857
This commit is contained in:
Goffin Simon
2017-10-30 17:02:38 +01:00
parent bb8f41d2a6
commit 6e06c54c8e
+1 -1
View File
@@ -562,7 +562,7 @@ class ProductProduct(models.Model):
history = self.env['product.price.history'].search([
('company_id', '=', company_id),
('product_id', 'in', self.ids),
('datetime', '<=', date or fields.Datetime.now())], limit=1)
('datetime', '<=', date or fields.Datetime.now())], order='datetime desc,id desc', limit=1)
return history.cost or 0.0
def _need_procurement(self):