changeset b60e7fb65cd4 in modules/stock_lot:default
details: https://hg.tryton.org/modules/stock_lot?cmd=changeset&node=b60e7fb65cd4
description:
        Improve moves synchronisation on drop shipment

        By using an origin drop as synchronisation key, the code is simplified 
but also
        it allows to follow when products are changed.
        This allows also to synchronise lots.
        The origin drop is filled on the customer moves when the drop shipment 
is set
        to waiting by using the purchase request as link.

        issue11700
        review411701003
diffstat:

 CHANGELOG   |  2 ++
 __init__.py |  4 ++++
 stock.py    |  7 +++++++
 tryton.cfg  |  2 ++
 4 files changed, 15 insertions(+), 0 deletions(-)

diffs (49 lines):

diff -r f31659cac7e8 -r b60e7fb65cd4 CHANGELOG
--- a/CHANGELOG Wed Sep 14 19:27:28 2022 +0200
+++ b/CHANGELOG Tue Sep 27 00:29:24 2022 +0200
@@ -1,3 +1,5 @@
+* Synchronize lot on drop shipment
+
 Version 6.4.0 - 2022-05-02
 * Bug fixes (see mercurial logs for details)
 * Add lot to assign criteria if not empty
diff -r f31659cac7e8 -r b60e7fb65cd4 __init__.py
--- a/__init__.py       Wed Sep 14 19:27:28 2022 +0200
+++ b/__init__.py       Tue Sep 27 00:29:24 2022 +0200
@@ -38,3 +38,7 @@
         stock.MoveAddLots,
         stock.InventoryCount,
         module='stock_lot', type_='wizard')
+    Pool.register(
+        stock.ShipmentDrop,
+        module='stock_lot', type_='model',
+        depends=['sale_supply_drop_shipment'])
diff -r f31659cac7e8 -r b60e7fb65cd4 stock.py
--- a/stock.py  Wed Sep 14 19:27:28 2022 +0200
+++ b/stock.py  Tue Sep 27 00:29:24 2022 +0200
@@ -673,6 +673,13 @@
         return super()._sync_move_key(move) + (('lot', move.lot),)
 
 
+class ShipmentDrop(metaclass=PoolMeta):
+    __name__ = 'stock.shipment.drop'
+
+    def _sync_move_key(self, move):
+        return super()._sync_move_key(move) + (('lot', move.lot),)
+
+
 class Period(metaclass=PoolMeta):
     __name__ = 'stock.period'
     lot_caches = fields.One2Many('stock.period.cache.lot', 'period',
diff -r f31659cac7e8 -r b60e7fb65cd4 tryton.cfg
--- a/tryton.cfg        Wed Sep 14 19:27:28 2022 +0200
+++ b/tryton.cfg        Tue Sep 27 00:29:24 2022 +0200
@@ -4,6 +4,8 @@
     ir
     product
     stock
+extras_depend:
+    sale_supply_drop_shipment
 xml:
     ir.xml
     stock.xml

Reply via email to