Commit cfbc502d authored by Łukasz Nowak's avatar Łukasz Nowak

Drop complexity.

Avoid rounding, as this solves UI problems which shall be addressed in
different way.

Avoid manual hack, as they can be addressed by builder and rule configuration.
parent 82160e3e
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
</item> </item>
<item> <item>
<key> <string>delivery_after_generation_script_id</string> </key> <key> <string>delivery_after_generation_script_id</string> </key>
<value> <string>SlapOSInvoiceTransaction_postTransactionLineGeneration</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>delivery_cell_collect_order</string> </key> <key> <string>delivery_cell_collect_order</string> </key>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<string>destination_section</string> <string>destination_section</string>
<string>source_payment</string> <string>source_payment</string>
<string>destination_payment</string> <string>destination_payment</string>
<string>resource</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -48,6 +49,10 @@ ...@@ -48,6 +49,10 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>category_movement_group_on_delivery</string> </value> <value> <string>category_movement_group_on_delivery</string> </value>
</item> </item>
<item>
<key> <string>update_always</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -58,9 +58,7 @@ ...@@ -58,9 +58,7 @@
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple/>
<string>solver/portal_solvers/Automatic Quantity Adopt Solver</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -30,9 +30,15 @@ ...@@ -30,9 +30,15 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>divergence_provider</string> </key> <key> <string>divergence_provider</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
<?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>#\n
# this script is called on the Invoice Transaction\n
# after the invoice_transaction_builder delivery builder\n
# created accounting lines in the invoice\n
# \n
\n
# Accounting specific: \n
# if every lines have the same resource, then copy the resource \n
# on the Transaction and delete resource on the lines.\n
# TODO: this is a Property Assignment Movement Group\n
\n
accounting_line_portal_type = context.getPortalAccountingMovementTypeList()\n
resources_keys = {}\n
for line in context.contentValues(portal_type=accounting_line_portal_type):\n
resources_keys[line.getResource()] = 1\n
\n
if len(resources_keys.keys()) == 1 :\n
# set the resource on the transaction\n
context.setResource(resources_keys.keys()[0])\n
# and delete on the invoice lines, so that if the user\n
# changes the ressource on the transaction, it also change on \n
# the lines. \n
for line in context.contentValues(portal_type=accounting_line_portal_type):\n
line.setResource(None)\n
assert(line.getResource() == context.getResource())\n
else :\n
raise ValueError, "%s doesn\'t have only one resource %s" % (\n
context.getPath(), resources_keys.keys())\n
\n
# round debit / credit on created transaction.\n
context.AccountingTransaction_roundDebitCredit()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>related_simulation_movement_path_list=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlapOSInvoiceTransaction_postTransactionLineGeneration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
81 82
\ 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