Store internal transit location when internal shipment is set to wait

This supports changing the configuration of the transit location over time
without breaking existing shipments.
This commit is contained in:
Cédric Krier
2025-02-08 12:45:40 +01:00
parent d1a846fa10
commit 54c124cec8
2 changed files with 47 additions and 9 deletions
+18
View File
@@ -25,6 +25,24 @@ Before
ALTER TABLE IF EXISTS "ir_model" RENAME COLUMN "model" TO "name";
ALTER TABLE IF EXISTS "ir_model_field" RENAME COLUMN "field_description" TO "string";
After
~~~~~
* If ``stock`` module is activated with internal shipment using transit
location, fill the internal transit location with the ``trytond-console``:
.. code-block:: python
Shipment = pool.get('stock.shipment.internal')
shipments = Shipment.search([('state', 'not in', ['request', 'draft'])])
for shipment in shipments:
state = shipment.state
shipment.state = 'draft'
shipment.internal_transit_location = shipment.transit_location
shipment.state = state
Shipment.save(shipments)
transaction.commit()
7.4
---