Commit f1001b9b authored by Yusei Tahara's avatar Yusei Tahara

Reuse python script for same routine.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19059 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 33362f05
...@@ -68,21 +68,12 @@ ...@@ -68,21 +68,12 @@
<value> <string>"""Return the \'side-specific\' reference, ie. the source reference or\n <value> <string>"""Return the \'side-specific\' reference, ie. the source reference or\n
destination reference.\n destination reference.\n
"""\n """\n
if selection_name is None:\n
# TODO: this should definitivly be REQUEST chached\n
selection_name = \'accounting_selection\'\n
\n
section_category=context.portal_selections.getSelectionParamsFor(selection_name).get(\'section_category\')\n
if not section_category:\n
return\n
\n
if brain is not None:\n if brain is not None:\n
transaction = brain.getObject()\n transaction = brain.getObject()\n
else:\n else:\n
transaction = context\n transaction = context\n
\n \n
source_section = transaction.getSourceSectionValue()\n if transaction.AccountingTransaction_isSourceView():\n
if source_section is not None and source_section.isMemberOf(section_category):\n
return transaction.getSourceReference()\n return transaction.getSourceReference()\n
return transaction.getDestinationReference()\n return transaction.getDestinationReference()\n
</string> </value> </string> </value>
...@@ -139,10 +130,8 @@ return transaction.getDestinationReference()\n ...@@ -139,10 +130,8 @@ return transaction.getDestinationReference()\n
<string>kwd</string> <string>kwd</string>
<string>None</string> <string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>section_category</string>
<string>transaction</string> <string>transaction</string>
<string>source_section</string> <string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
572 573
\ 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