[Erp5-report] r38190 yo - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 8 11:27:16 CEST 2010


Author: yo
Date: Wed Sep  8 11:27:16 2010
New Revision: 38190

URL: http://svn.erp5.org?rev=38190&view=rev
Log:
2010-09-08 yo
* Auto-fill mirror accounts, if necessary, before running the accounting transaction constraint.

Added:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_setDefaultMirrorAccountList.xml
    erp5/trunk/bt5/erp5_accounting/bt/template_catalog_search_key_list
Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
    erp5/trunk/bt5/erp5_accounting/bt/change_log
    erp5/trunk/bt5/erp5_accounting/bt/revision

Added: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_setDefaultMirrorAccountList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_setDefaultMirrorAccountList.xml?rev=38190&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_setDefaultMirrorAccountList.xml (added)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_setDefaultMirrorAccountList.xml [utf8] Wed Sep  8 11:27:16 2010
@@ -0,0 +1,162 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+    </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># Auto-fill mirror accounts in transaction lines automatically, if necessary.\n
+portal = context.getPortalObject()\n
+movement_data_list = []\n
+has_source = False\n
+has_destination = False\n
+for movement in context.contentValues(portal_type=portal.getPortalAccountingMovementTypeList()):\n
+  source_account = movement.getSourceValue(portal_type=\'Account\')\n
+  destination_account = movement.getDestinationValue(portal_type=\'Account\')\n
+  if source_account is not None:\n
+    has_source = True\n
+  if destination_account is not None:\n
+    has_destination = True\n
+  # Interested in movements which lack one side only.\n
+  if (source_account is not None) ^ (destination_account is not None):\n
+    movement_data_list((movement, source_account, destination_account))\n
+\n
+# If both are true, mirror accounting is used.\n
+if has_source and has_destination:\n
+  for movement, source_account, destination_account in movement_data_list:\n
+    if source_account is None:\n
+      account = destination_account\n
+      base_category = \'source\'\n
+    else:\n
+      account = source_account\n
+      base_category = \'destination\'\n
+    \n
+    mirror_account = account.getDefaultDestination()\n
+    if mirror_account:\n
+      movement.setProperty(base_category, mirror_account)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>**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>kw</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>movement_data_list</string>
+                            <string>False</string>
+                            <string>has_source</string>
+                            <string>has_destination</string>
+                            <string>_getiter_</string>
+                            <string>movement</string>
+                            <string>source_account</string>
+                            <string>destination_account</string>
+                            <string>None</string>
+                            <string>True</string>
+                            <string>account</string>
+                            <string>base_category</string>
+                            <string>mirror_account</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>AccountingTransaction_setDefaultMirrorAccountList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml?rev=38190&r1=38189&r2=38190&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/validateTransaction.xml [utf8] Wed Sep  8 11:27:16 2010
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -68,6 +65,9 @@ transaction = state_change[\'object\']\n
 if not transaction.getStartDate() and transaction.getStopDate():\n
   transaction.setStartDate(transaction.getStopDate())\n
 \n
+# XXX auto-fill mirror accounts, if necessary.\n
+transaction.AccountingTransaction_setDefaultMirrorAccountList()\n
+\n
 # Check constraints\n
 transaction.Base_checkConsistency()\n
 \n

Modified: erp5/trunk/bt5/erp5_accounting/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/change_log?rev=38190&r1=38189&r2=38190&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/change_log [utf8] Wed Sep  8 11:27:16 2010
@@ -1,3 +1,6 @@
+2010-09-08 yo
+* Auto-fill mirror accounts, if necessary, before running the accounting transaction constraint.
+
 2010-09-08 yusei
 Revert my change on AccountingTransactionModule_getJournalSectionLineList at 2010-09-02.
 

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=38190&r1=38189&r2=38190&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Wed Sep  8 11:27:16 2010
@@ -1 +1 @@
-1349
\ No newline at end of file
+1350
\ No newline at end of file

Added: erp5/trunk/bt5/erp5_accounting/bt/template_catalog_search_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/template_catalog_search_key_list?rev=38190&view=auto
==============================================================================
    (empty)




More information about the Erp5-report mailing list