summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2019-06-28 11:55:50 +0000
committerNicolas Martinelli <nim@odoo.com>2019-06-28 19:15:48 +0000
commit38eb5346c75fb97f215d59d208978cbc27a82b6e (patch)
tree31699c4ff4019e4d25f85942c2bee6763245fb19 /addons/web/static/src/js/views/basic/basic_controller.js
parent2cc3ec0b8a913da1fc74d1079b10b27ad3ac6a1d (diff)
[FIX] purchase_stock: average cost
- Create 2 rates: 2019-05-01: 1.0 2019-06-01: 0.5 - Set-up a product A in AVCO - Create a PO for A on 2019-05-15 - Receive the product after 2019-06-01 The AML are created with a rate of 0.5, but the product cost is updated with the rate of 1.0. This is because the stock move date is used when it is still assigned, and not done yet. As described in: https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L36 The date is the scheduled date until the move is done, then it is the date of the actual move processing. We change the date to today's date, since it is the value used to update the move date: https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L1143 opw-2006368 Note: the test has been slightly refactored to avoid an inconsistency between `fields.Date.context_today` and `fields.Datetime.now`. Now, they both return the same day. Moreover, the date is updated before each action. closes odoo/odoo#34444 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions