[Erp5-report] r37226 jerome - in /erp5/trunk/bt5/erp5_budget: SkinTemplateItem/portal_skins...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 21 18:13:20 CEST 2010


Author: jerome
Date: Wed Jul 21 18:13:19 2010
New Revision: 37226

URL: http://svn.erp5.org?rev=37226&view=rev
Log:
use new API getAvailableBudgetDict, getEngagedBudgetDict and getConsumedBudgetDict that does only one getInventoryList query for each budget line, and also shows consumptions for cells where no budget has been defined

Added:
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getAvailableBudgetCell.xml
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getConsumedBudgetCell.xml
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getEngagedBudgetCell.xml
Modified:
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewAvailableBudget/matrixbox.xml
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewConsumedBudget/matrixbox.xml
    erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewEngagedBudget/matrixbox.xml
    erp5/trunk/bt5/erp5_budget/bt/revision

Added: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getAvailableBudgetCell.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getAvailableBudgetCell.xml?rev=37226&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getAvailableBudgetCell.xml (added)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getAvailableBudgetCell.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>def getFakeBudgetCell(amount):\n
+  class FakeBudgetCell:\n
+    def getAvailableBudget(self):\n
+      return amount\n
+    def absolute_url(self):\n
+      return context.absolute_url()\n
+  return FakeBudgetCell()\n
+\n
+try:\n
+  available_budget_dict = container.REQUEST.other[script.getId()]\n
+except KeyError:\n
+  available_budget_dict = container.REQUEST.other[script.getId()] = context.getAvailableBudgetDict()\n
+\n
+return getFakeBudgetCell(available_budget_dict[args])\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>*args, **kw</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>args</string>
+                            <string>kw</string>
+                            <string>getFakeBudgetCell</string>
+                            <string>_getitem_</string>
+                            <string>_getattr_</string>
+                            <string>container</string>
+                            <string>script</string>
+                            <string>available_budget_dict</string>
+                            <string>KeyError</string>
+                            <string>context</string>
+                            <string>_write_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>BudgetLine_getAvailableBudgetCell</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getConsumedBudgetCell.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getConsumedBudgetCell.xml?rev=37226&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getConsumedBudgetCell.xml (added)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getConsumedBudgetCell.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>def getFakeBudgetCell(amount):\n
+  class FakeBudgetCell:\n
+    def getConsumedBudget(self):\n
+      return amount\n
+    def absolute_url(self):\n
+      return context.absolute_url()\n
+  return FakeBudgetCell()\n
+\n
+try:\n
+  consumed_budget_dict = container.REQUEST.other[script.getId()]\n
+except KeyError:\n
+  consumed_budget_dict = container.REQUEST.other[script.getId()] = context.getConsumedBudgetDict()\n
+\n
+return getFakeBudgetCell(consumed_budget_dict[args])\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>*args, **kw</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>args</string>
+                            <string>kw</string>
+                            <string>getFakeBudgetCell</string>
+                            <string>_getitem_</string>
+                            <string>_getattr_</string>
+                            <string>container</string>
+                            <string>script</string>
+                            <string>consumed_budget_dict</string>
+                            <string>KeyError</string>
+                            <string>context</string>
+                            <string>_write_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>BudgetLine_getConsumedBudgetCell</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getEngagedBudgetCell.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getEngagedBudgetCell.xml?rev=37226&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getEngagedBudgetCell.xml (added)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_getEngagedBudgetCell.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>def getFakeBudgetCell(amount):\n
+  class FakeBudgetCell:\n
+    def getEngagedBudget(self):\n
+      return amount\n
+    def absolute_url(self):\n
+      return context.absolute_url()\n
+  return FakeBudgetCell()\n
+\n
+try:\n
+  engaged_budget_dict = container.REQUEST.other[script.getId()]\n
+except KeyError:\n
+  engaged_budget_dict = container.REQUEST.other[script.getId()] = context.getEngagedBudgetDict()\n
+\n
+return getFakeBudgetCell(engaged_budget_dict[args])\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>*args, **kw</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>args</string>
+                            <string>kw</string>
+                            <string>getFakeBudgetCell</string>
+                            <string>_getitem_</string>
+                            <string>_getattr_</string>
+                            <string>container</string>
+                            <string>script</string>
+                            <string>engaged_budget_dict</string>
+                            <string>KeyError</string>
+                            <string>context</string>
+                            <string>_write_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>BudgetLine_getEngagedBudgetCell</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewAvailableBudget/matrixbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewAvailableBudget/matrixbox.xml?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewAvailableBudget/matrixbox.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewAvailableBudget/matrixbox.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>cell_getter_method</string>
                 <string>editable_attributes</string>
                 <string>global_attributes</string>
               </list>
@@ -76,6 +77,10 @@
             <value>
               <dictionary>
                 <item>
+                    <key> <string>cell_getter_method</string> </key>
+                    <value> <string>BudgetLine_getAvailableBudgetCell</string> </value>
+                </item>
+                <item>
                     <key> <string>editable_attributes</string> </key>
                     <value>
                       <list>

Modified: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewConsumedBudget/matrixbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewConsumedBudget/matrixbox.xml?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewConsumedBudget/matrixbox.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewConsumedBudget/matrixbox.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>cell_getter_method</string>
                 <string>editable_attributes</string>
                 <string>global_attributes</string>
               </list>
@@ -76,6 +77,10 @@
             <value>
               <dictionary>
                 <item>
+                    <key> <string>cell_getter_method</string> </key>
+                    <value> <string>BudgetLine_getConsumedBudgetCell</string> </value>
+                </item>
+                <item>
                     <key> <string>editable_attributes</string> </key>
                     <value>
                       <list>

Modified: erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewEngagedBudget/matrixbox.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewEngagedBudget/matrixbox.xml?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewEngagedBudget/matrixbox.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_viewEngagedBudget/matrixbox.xml [utf8] Wed Jul 21 18:13:19 2010
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>cell_getter_method</string>
                 <string>editable_attributes</string>
                 <string>global_attributes</string>
               </list>
@@ -76,6 +77,10 @@
             <value>
               <dictionary>
                 <item>
+                    <key> <string>cell_getter_method</string> </key>
+                    <value> <string>BudgetLine_getEngagedBudgetCell</string> </value>
+                </item>
+                <item>
                     <key> <string>editable_attributes</string> </key>
                     <value>
                       <list>

Modified: erp5/trunk/bt5/erp5_budget/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_budget/bt/revision?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_budget/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_budget/bt/revision [utf8] Wed Jul 21 18:13:19 2010
@@ -1 +1 @@
-292
\ No newline at end of file
+293
\ No newline at end of file




More information about the Erp5-report mailing list