Skip to content
Snippets Groups Projects
Commit 33fa9cff authored by David (dafr)'s avatar David (dafr)
Browse files

[FIX] stock_account: Use correct company for SVL account_move creation


The valuation field of the product_id is company-dependent.
If the user validate the picking in multi-company context with his current company != picking company, then the checks may fail, and the account move can not be created.

closes odoo/odoo#105149

X-original-commit: f2a4d537
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent dadd272d
Branches
Tags
No related merge requests found
......@@ -272,11 +272,11 @@ class StockMove(models.Model):
for svl in stock_valuation_layers:
if not svl.product_id.valuation == 'real_time':
if not svl.with_company(svl.company_id).product_id.valuation == 'real_time':
continue
if svl.currency_id.is_zero(svl.value):
continue
svl.stock_move_id._account_entry_move(svl.quantity, svl.description, svl.id, svl.value)
svl.stock_move_id.with_company(svl.company_id)._account_entry_move(svl.quantity, svl.description, svl.id, svl.value)
stock_valuation_layers._check_company()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment