[Erp5-report] r16099 - /erp5/trunk/products/ERP5/Tool/SimulationTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 6 09:58:49 CEST 2007


Author: vincent
Date: Thu Sep  6 09:58:49 2007
New Revision: 16099

URL: http://svn.erp5.org?rev=16099&view=rev
Log:
Add table name value when generating final query parameters to make possible to use bare column name after first half of parameter generation.
Update a user (update is not mandatory unless first half results have to be used).

Modified:
    erp5/trunk/products/ERP5/Tool/SimulationTool.py

Modified: erp5/trunk/products/ERP5/Tool/SimulationTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/SimulationTool.py?rev=16099&r1=16098&r2=16099&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/SimulationTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/SimulationTool.py Thu Sep  6 09:58:49 2007
@@ -415,6 +415,15 @@
           simulation_query = regular_query
         if simulation_query is not None:
           new_kw['query'] = simulation_query
+        # Sort on
+        if 'sort_on' in new_kw:
+          sort_on = new_kw['sort_on']
+          new_sort_on = []
+          for column_id, sort_direction in sort_on:
+            if '.' not in column_id:
+              column_id = '%s.%s' % (table, column_id)
+            new_sort_on.append((column_id, sort_direction))
+          new_kw['sort_on'] = tuple(new_sort_on)
         sql_kw.update(self.portal_catalog.buildSQLQuery(**new_kw))
         return sql_kw
 
@@ -1143,7 +1152,7 @@
       #sql_kw['order_by_expression'] = 'stock.date'
 
       result = self.getInventoryList(src__=src__,
-          sort_on = (('stock.date', 'ascending'),), group_by_movement=1, **kw)
+          sort_on = (('date', 'ascending'),), group_by_movement=1, **kw)
       if src__ :
         return result
 




More information about the Erp5-report mailing list