Commit f83fa78d authored by Jérome Perrin's avatar Jérome Perrin

Add a GROUP BY stock.date clause in Resource_zGetMovementHistoryList, to...

Add a GROUP BY stock.date clause in Resource_zGetMovementHistoryList, to display 2 movements when we have a movement from node N to node N with different start date and stop date.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9973 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 548d0501
...@@ -758,7 +758,7 @@ GROUP BY\n ...@@ -758,7 +758,7 @@ GROUP BY\n
<dtml-if group_by_expression>\n <dtml-if group_by_expression>\n
<dtml-var group_by_expression>\n <dtml-var group_by_expression>\n
<dtml-else>\n <dtml-else>\n
stock.uid, stock.node_uid, stock.resource_uid\n stock.uid, stock.node_uid, stock.resource_uid, stock.date\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if order_by_expression>\n <dtml-if order_by_expression>\n
...@@ -910,7 +910,7 @@ GROUP BY\n ...@@ -910,7 +910,7 @@ GROUP BY\n
<dtml-if group_by_expression>\n <dtml-if group_by_expression>\n
<dtml-var group_by_expression>\n <dtml-var group_by_expression>\n
<dtml-else>\n <dtml-else>\n
stock.uid, stock.node_uid, stock.resource_uid\n stock.uid, stock.node_uid, stock.resource_uid, stock.date\n
</dtml-if>\n </dtml-if>\n
\n \n
<dtml-if order_by_expression>\n <dtml-if order_by_expression>\n
......
76 65
\ No newline at end of file \ No newline at end of file
...@@ -917,6 +917,21 @@ class TestMovementHistoryList(InventoryAPITestCase): ...@@ -917,6 +917,21 @@ class TestMovementHistoryList(InventoryAPITestCase):
running_total_price += quantity * quantity # we've set price=quantity running_total_price += quantity * quantity # we've set price=quantity
self.assertEquals(running_total_price, brain.running_total_price) self.assertEquals(running_total_price, brain.running_total_price)
# bug #352
def testSameNodeDifferentDates(self):
getMovementHistoryList = self.getSimulationTool().getMovementHistoryList
date = DateTime()
mvt = self._makeMovement( quantity=2,
start_date=date,
stop_date=date+1,
source_value=self.node,
destination_value=self.node )
mvt_history_list = getMovementHistoryList(
node_uid=self.node.getUid(),)
self.assertEquals(2, len(mvt_history_list))
self.assertEquals(0, sum([r.total_quantity for r in mvt_history_list]))
class TestInventoryStat(InventoryAPITestCase): class TestInventoryStat(InventoryAPITestCase):
"""Tests Inventory Stat methods. """Tests Inventory Stat methods.
""" """
......
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