Commit 11457ad0 authored by Jérome Perrin's avatar Jérome Perrin

Fix Accounting Transaction Module to display the Third Party instead of the destination section.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9768 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 371daf96
...@@ -68,23 +68,21 @@ ...@@ -68,23 +68,21 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from ZTUtils import make_query\n <value> <string>section_category=selection.getParams().get(\'section_category\')\n
if not section_category:\n
return\n
\n \n
index = selection.getIndex()\n transaction = brain.getObject()\n
name = selection.getName()\n source_section = transaction.getSourceSectionValue()\n
object = brain.getObject()\n
if object is None:\n
return None\n
destination_section = object.getDestinationSectionValue()\n
if destination_section is None:\n
return None\n
url = destination_section.absolute_url()\n
method = \'Entity_viewAccountingTransactionList\'\n
kw = { \n
\'reset\' : \'1\', \n
}\n
\n \n
return url + \'/\' + method + \'?\' + make_query(kw)\n if source_section is not None and source_section.isMemberOf(section_category):\n
mirror_section = transaction.getDestinationSectionValue()\n
else:\n
mirror_section = transaction.getSourceSectionValue()\n
\n
if mirror_section is not None:\n
return "%s/Entity_viewAccountingTransactionList?reset:int=1" %\\\n
mirror_section.absolute_url()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -101,7 +99,7 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n ...@@ -101,7 +99,7 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>brain=None, selection=None, **kwd</string> </value> <value> <string>brain, selection=None, **kwd</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -130,17 +128,12 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n ...@@ -130,17 +128,12 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
<string>brain</string> <string>brain</string>
<string>selection</string> <string>selection</string>
<string>kwd</string> <string>kwd</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>index</string> <string>section_category</string>
<string>name</string> <string>transaction</string>
<string>object</string> <string>source_section</string>
<string>None</string> <string>None</string>
<string>destination_section</string> <string>mirror_section</string>
<string>url</string>
<string>method</string>
<string>kw</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -154,13 +147,12 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n ...@@ -154,13 +147,12 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
<value> <value>
<tuple> <tuple>
<none/> <none/>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>AccountingTransactionModule_getDestinationSectionUrl</string> </value> <value> <string>AccountingTransactionModule_getThirdPartyUrl</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -334,8 +334,8 @@ ...@@ -334,8 +334,8 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_destination_section_title</string> <string>AccountingTransaction_getThirdPartyTitle</string>
<string>Destination</string> <string>Third Party</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_portal_type</string> <string>translated_portal_type</string>
...@@ -403,8 +403,8 @@ ...@@ -403,8 +403,8 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_destination_section_title</string> <string>AccountingTransaction_getThirdPartyTitle</string>
<string>Destination</string> <string>Third Party</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_portal_type</string> <string>translated_portal_type</string>
...@@ -539,6 +539,10 @@ ...@@ -539,6 +539,10 @@
<key> <string>not_viewable</string> </key> <key> <string>not_viewable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
...@@ -601,8 +605,8 @@ ...@@ -601,8 +605,8 @@
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>default_destination_section_title</string> <string>AccountingTransaction_getThirdPartyTitle</string>
<string>Destination</string> <string>Third Party</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_portal_type</string> <string>translated_portal_type</string>
...@@ -682,8 +686,8 @@ ...@@ -682,8 +686,8 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>default_destination_section_title</string> <string>AccountingTransaction_getThirdPartyTitle</string>
<string>AccountingTransactionModule_getDestinationSectionUrl</string> <string>AccountingTransactionModule_getThirdPartyUrl</string>
</tuple> </tuple>
</list> </list>
</value> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>section_category=selection.getParams().get(\'section_category\')\n
if not section_category:\n
return\n
\n
transaction = brain.getObject()\n
source_section = transaction.getSourceSectionValue()\n
if source_section is not None and source_section.isMemberOf(section_category):\n
return transaction.getDestinationSectionTitle()\n
return transaction.getSourceSectionTitle()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection, **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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>brain</string>
<string>selection</string>
<string>kw</string>
<string>_getattr_</string>
<string>section_category</string>
<string>transaction</string>
<string>source_section</string>
<string>None</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_getThirdPartyTitle</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
27 29
\ No newline at end of file \ No newline at end of file
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