Commit 8a7c0eb3 authored by Jérome Perrin's avatar Jérome Perrin

script to get the list of budget cell matching a context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22315 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8cdf664e
<?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>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>\'\'\'Returns budget cells matching an accounting transaction line.\n
\'\'\'\n
portal = context.getPortalObject()\n
\n
def makeContext(doc, **kw):\n
categories = []\n
for k, v in kw.items():\n
if v:\n
categories.append(\'%s/%s\' % (k,v))\n
return doc.asContext(categories=categories)\n
\n
financial_section = \'\'\n
budget_section = \'\'\n
group = \'\'\n
\n
if context.AccountingTransaction_isSourceView():\n
node = context.getSourceValue()\n
if node is not None:\n
financial_section = node.getFinancialSection()\n
budget_section = node.getBudgetSection()\n
section = context.getSourceSectionValue()\n
if section is not None:\n
group = section.getGroup()\n
\n
tmp_context = makeContext(\n
context,\n
region=context.getSourceRegion(),\n
## XXX or destination region ? this means the budget configuration has\n
# to be known at that point.\n
source_section=context.getDestinationSection(),\n
destination_section=context.getSourceSection(),\n
source=context.getDestination(),\n
destination=context.getSource(),\n
resource=context.getResource(),\n
financial_section=financial_section,\n
budget_section=budget_section,\n
group=group,\n
)\n
else:\n
node = context.getDestinationValue()\n
if node is not None:\n
financial_section = node.getFinancialSection()\n
budget_section = node.getBudgetSection()\n
section = context.getDestinationSectionValue()\n
if section is not None:\n
group = section.getGroup()\n
\n
tmp_context = makeContext(\n
context,\n
region=context.getDestinationRegion(), #XXX\n
destination_section=context.getSourceSection(),\n
source_section=context.getDestinationSection(),\n
destination=context.getDestination(),\n
source=context.getSource(),\n
resource=context.getResource(),\n
financial_section=financial_section,\n
budget_section=budget_section,\n
group=group,\n
)\n
\n
return portal.portal_domains.searchPredicateList(context=tmp_context, portal_type=\'Budget Cell\')\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></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>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>makeContext</string>
<string>financial_section</string>
<string>budget_section</string>
<string>group</string>
<string>node</string>
<string>None</string>
<string>section</string>
<string>tmp_context</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>AccountingTransactionLine_getBudgetCellList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
33
\ No newline at end of file
34
\ 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