diff --git a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isDeliveryMovement.xml b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isDeliveryMovement.xml index b3326749dae187404e161e665909d0f617a6d2a3..7363bae51f62d980ce933e5361c63dd63d2051aa 100644 --- a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isDeliveryMovement.xml +++ b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isDeliveryMovement.xml @@ -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> diff --git a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isTaxMovement.xml b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isTaxMovement.xml index cbc2c9b9c98187563eb1743547d34dd694336a26..9e63a671043611858cbd982f0e11e2d010e750dc 100644 --- a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isTaxMovement.xml +++ b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_isTaxMovement.xml @@ -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> diff --git a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_testInvoiceTransactionRule.xml b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_testInvoiceTransactionRule.xml index 74a602dc2739420a7ec7d180c6f8a2f977e77c27..2e81a3c3162f5f605355ba11970e30240bf01689 100644 --- a/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_testInvoiceTransactionRule.xml +++ b/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/SimulationMovement_testInvoiceTransactionRule.xml @@ -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 diff --git a/bt5/erp5_invoicing/bt/revision b/bt5/erp5_invoicing/bt/revision index 2fb681e3f93b6b7e6441bd64271813a1ec293b5b..a76c74dcec6ab8ba53c5d5b4de054eb43f68fe67 100644 --- a/bt5/erp5_invoicing/bt/revision +++ b/bt5/erp5_invoicing/bt/revision @@ -1 +1 @@ -71 \ No newline at end of file +75 \ No newline at end of file