details:   https://code.tryton.org/tryton/commit/fb17c66b1776
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Nov 14 09:05:02 2025 +0100
description:
        Include origin name in stock move record name

        Closes #14359
diffstat:

 modules/production/stock.py |  3 +++
 modules/stock/move.py       |  8 +++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r d3b9bb7763a1 -r fb17c66b1776 modules/production/stock.py
--- a/modules/production/stock.py       Thu Nov 06 11:34:07 2025 +0100
+++ b/modules/production/stock.py       Fri Nov 14 09:05:02 2025 +0100
@@ -150,6 +150,9 @@
                 [m for m in moves if m.state == 'done' and m.production_input],
                 {'production_cost_price_updated': True})
 
+    def _rec_name_origin(self):
+        return super()._rec_name_origin() or self.production
+
 
 class ProductQuantitiesByWarehouseMove(metaclass=PoolMeta):
     __name__ = 'stock.product_quantities_warehouse.move'
diff -r d3b9bb7763a1 -r fb17c66b1776 modules/stock/move.py
--- a/modules/stock/move.py     Thu Nov 06 11:34:07 2025 +0100
+++ b/modules/stock/move.py     Fri Nov 14 09:05:02 2025 +0100
@@ -704,13 +704,19 @@
                                 move=move.rec_name,
                                 period=period.rec_name))
 
+    def _rec_name_origin(self):
+        return self.shipment
+
     def get_rec_name(self, name):
         pool = Pool()
         Lang = pool.get('ir.lang')
         lang = Lang.get()
-        return (lang.format_number_symbol(
+        name = (lang.format_number_symbol(
                 self.quantity, self.unit, digits=self.unit.digits)
             + ' %s' % self.product.rec_name)
+        if origin := (self._rec_name_origin() or self.origin):
+            name += f' @ {origin.rec_name}'
+        return name
 
     @classmethod
     def search_rec_name(cls, name, clause):

Reply via email to