**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.
stock_move.date AS date,
                    quant.cost as price_unit_on_quant,
                    stock_move.origin AS source,
                    stock_production_lot.name AS serial_number
                FROM
                    stock_quant as quant
                JOIN
                    stock_quant_move_rel ON stock_quant_move_rel.quant_id = quant.id
                JOIN
                    stock_move ON stock_move.id = stock_quant_move_rel.move_id
                LEFT JOIN
                    stock_production_lot ON stock_production_lot.id = quant.lot_id
                JOIN
                    stock_location source_location ON stock_move.location_id = source_location.id
                JOIN
                    stock_location dest_location ON stock_move.location_dest_id = dest_location.id
                JOIN
                    product_product ON product_product.id = stock_move.product_id
                JOIN
                    product_template ON product_template.id = product_product.product_tmpl_id
                WHERE quant.qty>0 AND stock_move.state = 'done' AND source_location.usage in ('internal', 'transit')
                AND (
                    not (dest_location.company_id is null and source_location.company_id is null) or
                    dest_location.company_id != source_location.company_id or
                    dest_location.usage not in ('internal', 'transit'))
                ))
                AS foo
                GROUP BY move_id, location_id, company_id, product_id, product_categ_id, date, source, product_template_id
            )""")