2f847c46292c409547cde402ae1dd38128eed4d2
Steps to reproduce: - Install Sales, Accounting and Inventory apps. - Go to Inventory > Configuration > Products > Product Categories. - Open All / Saleable / Office Furniture and: - Set the Inventory Valuation as Automated - Set the Costing Method as First In First Out (FIFO) - Go to Inventory > Reporting > Inventory Valuation - Open the toggle header then Click on the plus button at the header. - In the popup shown -Notice how the current value is 0-, set: - Added Value to 1000 - Counterpart Account to 600000 Expenses - Click on REVALUE, a new report appears. - Open the newly created report > Other Info, open the Journal Entry - In the Journal Items tab, notice the label says that `the valuation was changed from 1000 to 2000` while it should be `the valuation was changed from 0 to 2000`. Investigation: - the `current_value_svl` field is related to `product_id.value_svl` https://github.com/odoo/odoo/blob/7152fa4fb4a8b66ae72bbdc8177f2a787161f594/addons/stock_account/wizard/stock_valuation_layer_revaluation.py#L34 - Which get computend using `_compute_value_svl()` depending on `stock_valuation_layer_ids` - When we revaluate, we trigger `action_validate_revaluation` that performs this line https://github.com/odoo/odoo/blob/7152fa4fb4a8b66ae72bbdc8177f2a787161f594/addons/stock_account/wizard/stock_valuation_layer_revaluation.py#L110 creating new stock.valuation.layer triggering the `_compute_value_svl()` method setting the product `value_svl` to the updated value (current + added) which then updates `current_value_svl` being a related field - That's why now `current_value_svl` is the new value and not the old one. opw-3715522 closes odoo/odoo#157450 X-original-commit: 065b6632b133d780543c9f40beb536c2ff37ff52 Signed-off-by: William Henrotin (whe) <whe@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%