Commit 0a8cea63 authored by Julien Muchembled's avatar Julien Muchembled

Fixes concerning propagation of 'specialise' values via the simulation

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@39567 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 13decd0b
......@@ -97,7 +97,7 @@ if not invoice.contentValues(portal_type=\'Payment Condition\'):\n
clipboard = related_order.manage_copyObjects(ids=payment_condition_copy_id_list)\n
invoice.manage_pasteObjects(clipboard)\n
\n
if related_order is not None:\n
if related_order is not None and context.portal_skins.hasObject(\'erp5_simulation_legacy\'):\n
# copy trade condition:\n
if not context.getSpecialise():\n
context.edit(specialise=related_order.getSpecialise())\n
......
......@@ -40,6 +40,7 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>specialise</string>
<string>delivery_mode</string>
<string>incoterm</string>
<string>source</string>
......
......@@ -40,6 +40,7 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>specialise</string>
<string>delivery_mode</string>
<string>incoterm</string>
<string>source</string>
......
......@@ -47,6 +47,7 @@
<string>destination_account</string>
<string>source_function</string>
<string>destination_function</string>
<string>specialise</string>
</tuple>
</value>
</item>
......
......@@ -101,7 +101,13 @@ class InvoiceSimulationRule(RuleMixin, MovementCollectionUpdaterMixin, Predicate
class InvoicingRuleMovementGenerator(MovementGeneratorMixin):
def _getUpdatePropertyDict(self, input_movement):
return {'delivery': None}
# Filter out specialise values we don't want, like transformations
# XXX Should there be a configurable property on the rule ?
specialise_list = [x.getRelativeUrl()
for x in input_movement.getSpecialiseValueList()
if x.providesIBusinessProcess() or
x.getPortalType().endswith('Trade Condition')]
return {'delivery': None, 'specialise': specialise_list}
def _getInputMovementList(self, movement_list=None, rounding=None):
return [self._applied_rule.getParentValue(),]
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