Commit 4afface0 authored by Jérome Perrin's avatar Jérome Perrin

Inventory API: expose order_id in movement history list

The use case is to generate an unique id for each sides of the movement
or each "submovements" when using asMovementList
parent f0116d99
...@@ -490,6 +490,7 @@ FROM (\n ...@@ -490,6 +490,7 @@ FROM (\n
SELECT DISTINCT\n SELECT DISTINCT\n
catalog.path as path,\n catalog.path as path,\n
catalog.uid as uid,\n catalog.uid as uid,\n
stock.order_id as order_id,\n
catalog.relative_url as relative_url,\n catalog.relative_url as relative_url,\n
stock.date AS date_utc,\n stock.date AS date_utc,\n
stock.mirror_date AS mirror_date_utc,\n stock.mirror_date AS mirror_date_utc,\n
......
...@@ -1566,6 +1566,9 @@ class TestMovementHistoryList(InventoryAPITestCase): ...@@ -1566,6 +1566,9 @@ class TestMovementHistoryList(InventoryAPITestCase):
self.assertTrue(hasattr(brain, 'resource_relative_url')) self.assertTrue(hasattr(brain, 'resource_relative_url'))
self.assertEqual(brain.resource_relative_url, self.resource.getRelativeUrl()) self.assertEqual(brain.resource_relative_url, self.resource.getRelativeUrl())
# order_id is exposed on brains, useful to generate unique id, using "{uid}-{order_id}"
self.assertTrue(hasattr(brain, 'order_id'))
def testBrainGetItem(self): def testBrainGetItem(self):
"""Test __getitem__ interface on brains.""" """Test __getitem__ interface on brains."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment