[Erp5-report] r13456 - in /erp5/trunk/bt5/erp5_immobilisation: ActionTemplateItem/portal_ty...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 16 16:13:42 CET 2007


Author: seb
Date: Fri Mar 16 16:13:31 2007
New Revision: 13456

URL: http://svn.erp5.org?rev=13456&view=rev
Log:
We must take simulation movement wich are not related to a delivery when we want to build amortisation rules. The previous way of doing was not at all scalable

Added:
    erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_zSelectMovement.xml
Modified:
    erp5/trunk/bt5/erp5_immobilisation/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/select_items_to_build_amortisation_transactions.xml
    erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_selectMovement.xml
    erp5/trunk/bt5/erp5_immobilisation/bt/revision

Modified: erp5/trunk/bt5/erp5_immobilisation/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/select_items_to_build_amortisation_transactions.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_immobilisation/ActionTemplateItem/portal_types/Accounting%2520Transaction%2520Module/select_items_to_build_amortisation_transactions.xml?rev=13456&r1=13455&r2=13456&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_immobilisation/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/select_items_to_build_amortisation_transactions.xml (original)
+++ erp5/trunk/bt5/erp5_immobilisation/ActionTemplateItem/portal_types/Accounting%20Transaction%20Module/select_items_to_build_amortisation_transactions.xml Fri Mar 16 16:13:31 2007
@@ -62,7 +62,7 @@
         </item>
         <item>
             <key> <string>visible</string> </key>
-            <value> <int>1</int> </value>
+            <value> <int>0</int> </value>
         </item>
       </dictionary>
     </pickle>

Modified: erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_selectMovement.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_selectMovement.xml?rev=13456&r1=13455&r2=13456&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_selectMovement.xml (original)
+++ erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_selectMovement.xml Fri Mar 16 16:13:31 2007
@@ -68,13 +68,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>kw[\'parent_specialise_portal_type\'] = \'Amortisation Rule\'\n
-movement_list = [x.getObject() for x in context.portal_catalog(**kw)]\n
-#kw[\'src__\']=1\n
-#sql = context.portal_catalog(**kw)\n
-#context.log(\'sql\',sql)\n
-#context.log(\'movement_list\',movement_list)\n
-return filter(lambda x: len(x.getDeliveryValueList())==0, movement_list)\n
+            <value> <string>kw[\'parent_specialise_portal_type\'] = [\'Amortisation Rule\']\n
+kw[\'portal_type\']             = \'Simulation Movement\'\n
+\n
+kw.update(context.portal_catalog.buildSQLQuery(**kw))\n
+\n
+context.log(\'AmortisationTransaction_selectMovement\', \'SQL\\n%s\' % context.AmortisationTransaction_zSelectMovement(src__=1, **kw))\n
+\n
+if src__==0:\n
+  movement_list = [x.getObject() for x in context.AmortisationTransaction_zSelectMovement(**kw)]\n
+  #context.log(\'SaleOrder_selectMovement\', \'mvt : %s\' % movement_list)\n
+  return movement_list\n
+else:\n
+  return context.AmortisationTransaction_zSelectMovement(src__=1, **kw)\n
 </string> </value>
         </item>
         <item>
@@ -97,7 +103,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>**kw</string> </value>
+            <value> <string>src__=0, **kw</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -117,23 +123,23 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>0</int> </value>
+                        <value> <int>1</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>src__</string>
                             <string>kw</string>
                             <string>_write_</string>
+                            <string>_getattr_</string>
+                            <string>_apply_</string>
+                            <string>context</string>
                             <string>append</string>
                             <string>$append0</string>
                             <string>_getiter_</string>
-                            <string>_apply_</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
                             <string>x</string>
                             <string>movement_list</string>
-                            <string>filter</string>
                           </tuple>
                         </value>
                     </item>
@@ -145,7 +151,9 @@
         <item>
             <key> <string>func_defaults</string> </key>
             <value>
-              <none/>
+              <tuple>
+                <int>0</int>
+              </tuple>
             </value>
         </item>
         <item>

Added: erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_zSelectMovement.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_zSelectMovement.xml?rev=13456&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_zSelectMovement.xml (added)
+++ erp5/trunk/bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationTransaction_zSelectMovement.xml Fri Mar 16 16:13:31 2007
@@ -1,0 +1,240 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.ZSQLMethods.SQL</string>
+          <string>SQL</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_arg</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="Args" module="Shared.DC.ZRDB.Aqueduct"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_data</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>from_table_list</string> </key>
+                                <value>
+                                  <dictionary>
+                                    <item>
+                                        <key> <string>type</string> </key>
+                                        <value> <string>list</string> </value>
+                                    </item>
+                                  </dictionary>
+                                </value>
+                            </item>
+                            <item>
+                                <key> <string>order_by_expression</string> </key>
+                                <value>
+                                  <dictionary/>
+                                </value>
+                            </item>
+                            <item>
+                                <key> <string>where_expression</string> </key>
+                                <value>
+                                  <dictionary/>
+                                </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>_keys</string> </key>
+                        <value>
+                          <list>
+<string>from_table_list</string>
+<string>where_expression</string>
+<string>order_by_expression</string>
+                          </list>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>allow_simple_one_argument_traversal</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>arguments_src</string> </key>
+            <value> <string>from_table_list:list\r\n
+where_expression\r\n
+order_by_expression</string> </value>
+        </item>
+        <item>
+            <key> <string>cache_time_</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>class_file_</string> </key>
+            <value> <string>ZSQLCatalog.zsqlbrain</string> </value>
+        </item>
+        <item>
+            <key> <string>class_name_</string> </key>
+            <value> <string>ZSQLBrain</string> </value>
+        </item>
+        <item>
+            <key> <string>connection_hook</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>connection_id</string> </key>
+            <value> <string>erp5_sql_connection</string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>AmortisationTransaction_zSelectMovement</string> </value>
+        </item>
+        <item>
+            <key> <string>max_cache_</string> </key>
+            <value> <int>100</int> </value>
+        </item>
+        <item>
+            <key> <string>max_rows_</string> </key>
+            <value> <int>1000</int> </value>
+        </item>
+        <item>
+            <key> <string>src</string> </key>
+            <value> <string encoding="cdata"><![CDATA[
+
+SELECT DISTINCT\n
+  catalog.uid,\n
+  catalog.path,\n
+  catalog.relative_url,\n
+  catalog.id\n
+\n
+FROM\n
+  movement as simulation_movement\n
+<dtml-in prefix="table" expr="from_table_list"> \n
+  <dtml-if expr="table_key != \'catalog\'">\n
+  , <dtml-var table_item> AS <dtml-var table_key>\n
+  </dtml-if>\n
+</dtml-in>\n
+  , catalog\n
+  LEFT JOIN category \n
+    ON (catalog.uid = category.uid\n
+        AND category.base_category_uid = <dtml-sqlvar "portal_categories.delivery.getUid()" type="int">)\n
+WHERE\n
+  1=1\n
+  <dtml-if where_expression>\n
+    AND <dtml-var where_expression> \n
+  </dtml-if>\n
+  AND simulation_movement.uid = catalog.uid\n
+  AND category.category_uid is NULL\n
+\n
+<dtml-if order_by_expression>\n
+ORDER BY <dtml-var order_by_expression>\n
+</dtml-if>
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>template</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="SQL" module="Shared.DC.ZRDB.DA"/>
+                </klass>
+                <none/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>__name__</string> </key>
+                        <value> <string encoding="cdata"><![CDATA[
+
+<string>
+
+]]></string> </value>
+                    </item>
+                    <item>
+                        <key> <string>_vars</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>globals</string> </key>
+                        <value>
+                          <dictionary/>
+                        </value>
+                    </item>
+                    <item>
+                        <key> <string>raw</string> </key>
+                        <value> <string encoding="cdata"><![CDATA[
+
+SELECT DISTINCT\n
+  catalog.uid,\n
+  catalog.path,\n
+  catalog.relative_url,\n
+  catalog.id\n
+\n
+FROM\n
+  movement as simulation_movement\n
+<dtml-in prefix="table" expr="from_table_list"> \n
+  <dtml-if expr="table_key != \'catalog\'">\n
+  , <dtml-var table_item> AS <dtml-var table_key>\n
+  </dtml-if>\n
+</dtml-in>\n
+  , catalog\n
+  LEFT JOIN category \n
+    ON (catalog.uid = category.uid\n
+        AND category.base_category_uid = <dtml-sqlvar "portal_categories.delivery.getUid()" type="int">)\n
+WHERE\n
+  1=1\n
+  <dtml-if where_expression>\n
+    AND <dtml-var where_expression> \n
+  </dtml-if>\n
+  AND simulation_movement.uid = catalog.uid\n
+  AND category.category_uid is NULL\n
+\n
+<dtml-if order_by_expression>\n
+ORDER BY <dtml-var order_by_expression>\n
+</dtml-if>
+
+]]></string> </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_immobilisation/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_immobilisation/bt/revision?rev=13456&r1=13455&r2=13456&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_immobilisation/bt/revision (original)
+++ erp5/trunk/bt5/erp5_immobilisation/bt/revision Fri Mar 16 16:13:31 2007
@@ -1,1 +1,1 @@
-22
+27




More information about the Erp5-report mailing list