[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) <whe@odoo.com>
This commit is contained in:
Haris (MHCH)
2023-07-17 12:06:15 +02:00
parent 630690ca1a
commit a5d4966212
+2 -2
View File
@@ -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