From db543651e569501894986d63d0ff97949d7cd28d Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Tue, 3 Mar 2026 10:18:00 +0700 Subject: [PATCH] feat: Enhance stock valuation layer descriptions by including the readjustment name and specific context. --- models/stock_readjust_valuation.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/models/stock_readjust_valuation.py b/models/stock_readjust_valuation.py index 29f405f..3971557 100644 --- a/models/stock_readjust_valuation.py +++ b/models/stock_readjust_valuation.py @@ -288,7 +288,7 @@ class StockReadjustValuation(models.Model): initial_diff = line.target_initial_value - line.initial_value if not float_is_zero(initial_diff, precision_digits=2): - self._create_correction_layer(line.product_id, initial_diff, self.date_start, _("Readjustment: Initial Value")) + self._create_correction_layer(line.product_id, initial_diff, self.date_start, f"{self.name} - {_('Readjustment: Initial Value')}") line.product_id.sudo().write({'standard_price': line.new_average_cost}) @@ -715,7 +715,7 @@ class StockReadjustValuation(models.Model): svl_vals = { 'company_id': self.company_id.id, 'product_id': product.id, - 'description': label_text, + 'description': ref_text, 'stock_move_id': move.id, 'quantity': 0, 'value': amount, # Direct usage of amount @@ -806,7 +806,7 @@ class StockReadjustValuation(models.Model): # Create a layer to adjust the starting value # We simply create a value-only layer. # Value = initial_diff. - self._create_correction_layer(line.product_id, initial_diff, self.date_start, _("Readjustment: Initial Value")) + self._create_correction_layer(line.product_id, initial_diff, self.date_start, f"{self.name} - {_('Readjustment: Initial Value')}") new_cost = line.new_average_cost @@ -971,7 +971,7 @@ class StockReadjustValuation(models.Model): credit_acc = stock_acc_id amt = abs(diff) - description = _("Readjustment MO: %s") % production.name + description = f"{self.name} - {_('Readjustment MO:')} {production.name}" move_vals = { 'journal_id': self.journal_id.id, @@ -1025,7 +1025,7 @@ class StockReadjustValuation(models.Model): svl_vals = { 'company_id': self.company_id.id, 'product_id': move.product_id.id, - 'description': _('Readjustment: %s') % self.name, + 'description': f"{self.name} - Adj for {move.name}", 'stock_move_id': move.id, 'quantity': 0, 'value': -amount, @@ -1041,7 +1041,7 @@ class StockReadjustValuation(models.Model): svl_vals = { 'company_id': self.company_id.id, 'product_id': move.product_id.id, - 'description': _('Readjustment: %s') % self.name, + 'description': f"{self.name} - Adj for {move.name}", 'stock_move_id': move.id, 'quantity': 0, 'value': -amount, @@ -1460,7 +1460,7 @@ class StockReadjustValuation(models.Model): svl_vals = { 'company_id': self.company_id.id, 'product_id': layer.product_id.id, - 'description': _('Readjustment: %s') % self.name, + 'description': f"{self.name} - Adj for {layer.stock_move_id.name}", 'stock_move_id': layer.stock_move_id.id, 'quantity': 0, 'value': -amount, # Adjustment to the ASSET value on the layer?