From a5d4966212ea7db59e618828b41395fb551a0b98 Mon Sep 17 00:00:00 2001 From: "Haris (MHCH)" Date: Wed, 12 Jul 2023 06:13:28 +0000 Subject: [PATCH] [FIX] stock_account: fix svl label Fixes the formatted string to add the correct reference in case of no picking. e.g. mrp correction To Fix: without parenthesis around the expression, the first value is considered as the value instead of evaluating the complete expression. **Results in:** `Correction of False (modification of past move)` closes odoo/odoo#128619 X-original-commit: 81fd11fe70357f638434bab44705c91008efb25f Signed-off-by: William Henrotin (whe) --- addons/stock_account/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/models/stock_move.py b/addons/stock_account/models/stock_move.py index fae10e7c704..df278a7b6cf 100644 --- a/addons/stock_account/models/stock_move.py +++ b/addons/stock_account/models/stock_move.py @@ -184,7 +184,7 @@ class StockMove(models.Model): svl_vals = move.product_id._prepare_out_svl_vals(forced_quantity or valued_quantity, move.company_id) svl_vals.update(move._prepare_common_svl_vals()) if forced_quantity: - svl_vals['description'] = 'Correction of %s (modification of past move)' % move.picking_id.name or move.name + svl_vals['description'] = 'Correction of %s (modification of past move)' % (move.picking_id.name or move.name) svl_vals['description'] += svl_vals.pop('rounding_adjustment', '') svl_vals_list.append(svl_vals) return self.env['stock.valuation.layer'].sudo().create(svl_vals_list) @@ -374,7 +374,7 @@ class StockMove(models.Model): svl_vals = move.product_id._prepare_in_svl_vals(forced_quantity or valued_quantity, unit_cost) svl_vals.update(move._prepare_common_svl_vals()) if forced_quantity: - svl_vals['description'] = 'Correction of %s (modification of past move)' % move.picking_id.name or move.name + svl_vals['description'] = 'Correction of %s (modification of past move)' % (move.picking_id.name or move.name) svl_vals_list.append(svl_vals) return svl_vals_list