Commit 0e356f09 authored by Jérome Perrin's avatar Jérome Perrin

To support Accounting genereation from tax in orders,...

To support Accounting genereation from tax in orders, SimulationMovement_testInvoiceTransactionRule must be applied on movements generated from Tax Rule.
SimulationMovement_is*Movement should check in a shallower level if there's no movement attached at current level - again, this happen when tax movements are in order and not in invoice.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20688 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aab3dc83
......@@ -67,11 +67,15 @@
<key> <string>_body</string> </key>
<value> <string>"""Tests if this simulation movement is not related to a Tax Movement\n
"""\n
real_movement = context.getDeliveryValue()\n
if real_movement is None:\n
real_movement = context.getOrderValue()\n
def testSimulationMovement(movement):\n
real_movement = movement.getDeliveryValue()\n
if real_movement is None:\n
real_movement = movement.getOrderValue()\n
if real_movement is None:\n
return testSimulationMovement(movement.getParentValue().getParentValue())\n
return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList()\n
\n
return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList()\n
return testSimulationMovement(context)\n
</string> </value>
</item>
<item>
......@@ -120,10 +124,8 @@ return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>real_movement</string>
<string>None</string>
<string>testSimulationMovement</string>
<string>context</string>
</tuple>
</value>
</item>
......
......@@ -67,11 +67,15 @@
<key> <string>_body</string> </key>
<value> <string>"""Tests if this simulation movement is related to a Tax Movement\n
"""\n
real_movement = context.getDeliveryValue()\n
if real_movement is None:\n
real_movement = context.getOrderValue()\n
def testSimulationMovement(movement):\n
real_movement = movement.getDeliveryValue()\n
if real_movement is None:\n
real_movement = movement.getOrderValue()\n
if real_movement is None:\n
return testSimulationMovement(movement.getParentValue().getParentValue())\n
return real_movement.getPortalType() == "Tax Line"\n
\n
return real_movement.getPortalType() == "Tax Line"\n
return testSimulationMovement(context)\n
</string> </value>
</item>
<item>
......@@ -120,10 +124,8 @@ return real_movement.getPortalType() == "Tax Line"\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>real_movement</string>
<string>None</string>
<string>testSimulationMovement</string>
<string>context</string>
</tuple>
</value>
</item>
......
......@@ -72,7 +72,9 @@ if parent.getPortalType() != \'Applied Rule\':\n
return False\n
\n
parent_rule = parent.getSpecialiseValue()\n
if parent_rule.getPortalType() not in [\'Invoice Rule\', \'Invoicing Rule\']:\n
if parent_rule.getPortalType() not in (\'Invoice Rule\',\n
\'Invoicing Rule\',\n
\'Tax Rule\'):\n
return False\n
\n
delivery_movement = movement.getDeliveryValue()\n
......
71
\ No newline at end of file
75
\ 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