Commit 7f8006cc authored by Jérome Perrin's avatar Jérome Perrin

activate builder for invoice lines, then builder for tax lines.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20471 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4f19b45c
<?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>packing_list = sci[\'object\']\n
delivery_tool = sci.getPortal().portal_deliveries\n
\n
found = 0\n
builder_id_list = [\'sale_invoice_builder\', \'purchase_invoice_builder\']\n
for builder_id in builder_id_list:\n
if hasattr(delivery_tool, builder_id):\n
found = 1\n
builder = getattr(delivery_tool, builder_id)\n
builder.activate(\n
after_method_id = [ \'expand\', \n
\'recursiveImmediateReindexObject\',\n
\'updateAppliedRule\',\n
\'immediateReindexObject\' ],\n
).build()\n
\n
if not found:\n
packing_list.log("ERP5 Simulation",\n
"Unable to build Invoice from packing list at %s "\\\n
": no builder" % packing_list.getPath())\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>sci</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>sci</string>
<string>_getitem_</string>
<string>packing_list</string>
<string>_getattr_</string>
<string>delivery_tool</string>
<string>found</string>
<string>builder_id_list</string>
<string>_getiter_</string>
<string>builder_id</string>
<string>hasattr</string>
<string>getattr</string>
<string>builder</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>PackingList_buildInvoice</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -65,10 +65,36 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>packing_list =sci[\'object\']\n
<value> <string>from Products.ERP5Type.Log import log\n
packing_list = sci[\'object\']\n
delivery_tool = sci.getPortal().portal_deliveries\n
\n
if packing_list.getPortalType() == \'Purchase Packing List\':\n
return context.PackingList_buildInvoice(sci)\n
tag = \'build_invoice_%s\' % packing_list.getRelativeUrl()\n
invoice_line_builder = getattr(delivery_tool, \'purchase_invoice_builder\', None)\n
if invoice_line_builder is not None:\n
invoice_line_builder.activate(\n
tag=tag,\n
activate_kw=dict(tag=tag),\n
after_method_id = [ \'expand\', \n
\'recursiveImmediateReindexObject\',\n
\'updateAppliedRule\',\n
\'immediateReindexObject\' ],\n
).build()\n
else:\n
log(\'no purchase_invoice_builder found\')\n
\n
invoice_tax_builder = getattr(delivery_tool, \'purchase_invoice_tax_builder\', None)\n
if invoice_tax_builder is not None:\n
invoice_tax_builder.activate(\n
tag=tag,\n
after_method_id = [ \'expand\', \n
\'recursiveImmediateReindexObject\',\n
\'updateAppliedRule\',\n
\'immediateReindexObject\' ],\n
).build()\n
else:\n
log(\'no purchase_invoice_tax_builder found\')\n
</string> </value>
</item>
<item>
......@@ -112,10 +138,18 @@ if packing_list.getPortalType() == \'Purchase Packing List\':\n
<value>
<tuple>
<string>sci</string>
<string>Products.ERP5Type.Log</string>
<string>log</string>
<string>_getitem_</string>
<string>packing_list</string>
<string>_getattr_</string>
<string>context</string>
<string>delivery_tool</string>
<string>tag</string>
<string>getattr</string>
<string>None</string>
<string>invoice_line_builder</string>
<string>dict</string>
<string>invoice_tax_builder</string>
</tuple>
</value>
</item>
......
......@@ -65,10 +65,36 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>packing_list =sci[\'object\']\n
<value> <string>from Products.ERP5Type.Log import log\n
packing_list = sci[\'object\']\n
delivery_tool = sci.getPortal().portal_deliveries\n
\n
if packing_list.getPortalType() == \'Sale Packing List\':\n
return context.PackingList_buildInvoice(sci)\n
tag = \'build_invoice_%s\' % packing_list.getRelativeUrl()\n
invoice_line_builder = getattr(delivery_tool, \'sale_invoice_builder\', None)\n
if invoice_line_builder is not None:\n
invoice_line_builder.activate(\n
tag=tag,\n
activate_kw=dict(tag=tag),\n
after_method_id = [ \'expand\', \n
\'recursiveImmediateReindexObject\',\n
\'updateAppliedRule\',\n
\'immediateReindexObject\' ],\n
).build()\n
else:\n
log(\'no sale_invoice_builder found\')\n
\n
invoice_tax_builder = getattr(delivery_tool, \'sale_invoice_tax_builder\', None)\n
if invoice_tax_builder is not None:\n
invoice_tax_builder.activate(\n
tag=tag,\n
after_method_id = [ \'expand\', \n
\'recursiveImmediateReindexObject\',\n
\'updateAppliedRule\',\n
\'immediateReindexObject\' ],\n
).build()\n
else:\n
log(\'no sale_invoice_tax_builder found\')\n
</string> </value>
</item>
<item>
......@@ -112,10 +138,18 @@ if packing_list.getPortalType() == \'Sale Packing List\':\n
<value>
<tuple>
<string>sci</string>
<string>Products.ERP5Type.Log</string>
<string>log</string>
<string>_getitem_</string>
<string>packing_list</string>
<string>_getattr_</string>
<string>context</string>
<string>delivery_tool</string>
<string>tag</string>
<string>getattr</string>
<string>None</string>
<string>invoice_line_builder</string>
<string>dict</string>
<string>invoice_tax_builder</string>
</tuple>
</value>
</item>
......
255
\ No newline at end of file
256
\ 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