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 @@ ...@@ -67,11 +67,15 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Tests if this simulation movement is not related to a Tax Movement\n <value> <string>"""Tests if this simulation movement is not related to a Tax Movement\n
"""\n """\n
real_movement = context.getDeliveryValue()\n def testSimulationMovement(movement):\n
if real_movement is None:\n real_movement = movement.getDeliveryValue()\n
real_movement = context.getOrderValue()\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 \n
return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList()\n return testSimulationMovement(context)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -120,10 +124,8 @@ return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList ...@@ -120,10 +124,8 @@ return real_movement.getPortalType() not in context.getPortalTaxMovementTypeList
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>_getattr_</string> <string>testSimulationMovement</string>
<string>context</string> <string>context</string>
<string>real_movement</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -67,11 +67,15 @@ ...@@ -67,11 +67,15 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Tests if this simulation movement is related to a Tax Movement\n <value> <string>"""Tests if this simulation movement is related to a Tax Movement\n
"""\n """\n
real_movement = context.getDeliveryValue()\n def testSimulationMovement(movement):\n
if real_movement is None:\n real_movement = movement.getDeliveryValue()\n
real_movement = context.getOrderValue()\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 \n
return real_movement.getPortalType() == "Tax Line"\n return testSimulationMovement(context)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -120,10 +124,8 @@ return real_movement.getPortalType() == "Tax Line"\n ...@@ -120,10 +124,8 @@ return real_movement.getPortalType() == "Tax Line"\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>_getattr_</string> <string>testSimulationMovement</string>
<string>context</string> <string>context</string>
<string>real_movement</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -72,7 +72,9 @@ if parent.getPortalType() != \'Applied Rule\':\n ...@@ -72,7 +72,9 @@ if parent.getPortalType() != \'Applied Rule\':\n
return False\n return False\n
\n \n
parent_rule = parent.getSpecialiseValue()\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 return False\n
\n \n
delivery_movement = movement.getDeliveryValue()\n delivery_movement = movement.getDeliveryValue()\n
......
71 75
\ 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