**Impacted versions:** 10.0

**Steps to reproduce:**

1. Create a new Stockable Product
2. Set cost price to `2.00`
3. Adjust stock to 10 pcs
4. Enable developer mode
5. Go to Inventory > Reports > Inventory at Date
6. Select current time and retrieve the inventory value

**Current behavior:**
The stock valuation for the product is `0.0`.

**Expected behavior:**
The stock valuation for the product should be `20.0`

**Workaround:**
So, to overcome this issue currently we need to restart odoo and import and export the cost prices for every product.

**Other observations:**
- It seems that `product.price.history` uses [current date without lambda](https://github.com/odoo/odoo/blob/10.0/addons/product/models/product.py#L99) as `datetime`, so the history entry always gets the `datetime` when Odoo was last started up. 
- The second problem is that when product is first created, Odoo creates **two** price history entries with the same `datetime`, `write_date` and `create_date`, but different `cost`. The stock valuation report only takes one of them into account.

**Video/Screenshot link (optional):**
![valuation_issue_workaround](https://cloud.githubusercontent.com/assets/1525066/21567016/63508536-ceb1-11e6-9e1a-0be500f656b9.gif)

.. and the price history in the database:

| id | create_uid | product_id | company_id | datetime                   | cost | write_date                 | create_date                | write_uid | 
|----|------------|------------|------------|----------------------------|------|----------------------------|----------------------------|-----------| 
| 11 | 1          | 5          | 1          | 2016-12-30 10:48:16.000000 | 0    | 2016-12-30 14:52:39.668846 | 2016-12-30 14:52:39.668846 | 1         | 
| 12 | 1          | 5          | 1          | 2016-12-30 10:48:16.000000 | 2    | 2016-12-30 14:52:39.668846 | 2016-12-30 14:52:39.668846 | 1         | 
| 13 | 1          | 5          | 1          | 2016-12-30 10:48:16.000000 | 3    | 2016-12-30 14:53:05.303394 | 2016-12-30 14:53:05.303394 | 1         | 
| 14 | 1          | 5          | 1          | 2016-12-30 14:53:26.000000 | 2    | 2016-12-30 14:53:36.890684 | 2016-12-30 14:53:36.890684 | 1         | 

As you can see, ID's 11 and 12 were created on the exact same millisecond. I changed the price in ID 13 but the `datetime` is still the same. The `datetime` only changes when I restart Odoo.
addons/stock_account/report/stock_history.py
from odoo import api, fields, models, tools
from odoo.fields import Datetime as fieldsDatetime
class StockHistory(models.Model):
    _name = 'stock.history'
    _auto = False
    _order = 'date asc'
    move_id = fields.Many2one('stock.move', 'Stock Move', required=True)
    location_id = fields.Many2one('stock.location', 'Location', required=True)
    company_id = fields.Many2one('res.company', 'Company')
    product_id = fields.Many2one('product.product', 'Product', required=True)
    product_categ_id = fields.Many2one('product.category', 'Product Category', required=True)
    quantity = fields.Float('Product Quantity')
    date = fields.Datetime('Operation Date')
    price_unit_on_quant = fields.Float('Value')
    inventory_value = fields.Float('Inventory Value', compute='_compute_inventory_value', readonly=True)
    source = fields.Char('Source')
    product_template_id = fields.Many2one('product.template', 'Product Template', required=True)
    serial_number = fields.Char('Lot/Serial Number', required=True)
    @api.model
    def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
        res = super(StockHistory, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
        if 'inventory_value' in fields:
            date = self._context.get('history_date', fieldsDatetime.now())
            stock_history = self.env['stock.history']
            group_lines = {}
            for line in res:
                domain = line.get('__domain', domain)