summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2017-10-30 13:49:01 +0100
committerGoffin Simon <sig@odoo.com>2017-10-30 17:02:38 +0100
commit6e06c54c8e72cdab892610734bf2617c06a47272 (patch)
tree3506a7f3c2808259a0da7fd0c3314577adb84fba /addons
parentbb8f41d2a619b300b7cc9274bc6e82e314df0adb (diff)
[FIX] product: Inventory at Date does not show the correct valuation
Fine tuning of this commit: 51d072db444bfd2dcad18122b502a4d3a98627f4 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
Diffstat (limited to 'addons')
-rw-r--r--addons/product/models/product.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/product/models/product.py b/addons/product/models/product.py
index c3c79628e5c..549aa9e4de3 100644
--- a/addons/product/models/product.py
+++ b/addons/product/models/product.py
@@ -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):