From aab8c38dffde894ead4316ecb3251a49118686b7 Mon Sep 17 00:00:00 2001 From: Tatuya Kamada <tatuya@nexedi.com> Date: Wed, 29 Sep 2010 09:17:37 +0000 Subject: [PATCH] 2010-09-28 tatuya * Stop overwriting a value by movement_resource_interaraction_workflow when the categories are already set a valid value as the new resource. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38742 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../Movement_copyBaseContributionFromResource.xml | 13 ++++++++----- .../Movement_copyQuantityUnitFromResource.xml | 11 +++++++---- .../scripts/Movement_copyUseFromResource.xml | 11 +++++++---- bt5/erp5_base/bt/change_log | 3 +++ bt5/erp5_base/bt/revision | 2 +- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyBaseContributionFromResource.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyBaseContributionFromResource.xml index 0283156f74..9d90225506 100644 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyBaseContributionFromResource.xml +++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyBaseContributionFromResource.xml @@ -2,10 +2,7 @@ <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> - <tuple> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - <tuple/> - </tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> </pickle> <pickle> <dictionary> @@ -57,7 +54,12 @@ \n resource = movement.getResourceValue()\n if resource is not None:\n - movement.setBaseContributionList(resource.getBaseContributionList())\n + # if the movement already have a base contribution which is valid for this resource, don\'t change it\n + movement_base_contribution = movement.getBaseContribution()\n + if movement_base_contribution and movement_base_contribution in resource.getBaseContributionList():\n + return\n + # otherwise initialise to the default base contribution\n + movement.setBaseContribution(resource.getDefaultBaseContribution())\n </string> </value> </item> <item> @@ -108,6 +110,7 @@ if resource is not None:\n <string>_getattr_</string> <string>resource</string> <string>None</string> + <string>movement_base_contribution</string> </tuple> </value> </item> diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyQuantityUnitFromResource.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyQuantityUnitFromResource.xml index ab40de43f6..595865de21 100644 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyQuantityUnitFromResource.xml +++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyQuantityUnitFromResource.xml @@ -2,10 +2,7 @@ <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> - <tuple> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - <tuple/> - </tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> </pickle> <pickle> <dictionary> @@ -57,6 +54,11 @@ \n resource = movement.getResourceValue()\n if resource is not None:\n + # if the movement already have a quantity unit which is valid for this resource, don\'t change it\n + movement_quantity_unit = movement.getQuantityUnit()\n + if movement_quantity_unit and movement_quantity_unit in resource.getQuantityUnitList():\n + return\n + # otherwise initialise to the default quantity unit\n movement.setQuantityUnit(resource.getDefaultQuantityUnit())\n </string> </value> </item> @@ -108,6 +110,7 @@ if resource is not None:\n <string>_getattr_</string> <string>resource</string> <string>None</string> + <string>movement_quantity_unit</string> </tuple> </value> </item> diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyUseFromResource.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyUseFromResource.xml index 22c0e9a3ef..090d4b4e34 100644 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyUseFromResource.xml +++ b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/movement_resource_interaction_workflow/scripts/Movement_copyUseFromResource.xml @@ -2,10 +2,7 @@ <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> - <tuple> - <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> - <tuple/> - </tuple> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> </pickle> <pickle> <dictionary> @@ -57,6 +54,11 @@ \n resource = movement.getResourceValue()\n if resource is not None:\n + # if the movement already have a use which is valid for this resource, don\'t change it\n + movement_use = movement.getUse()\n + if movement_use and movement_use in resource.getUseList():\n + return\n + # otherwise initialise to the default use\n movement.setUse(resource.getDefaultUse())\n </string> </value> </item> @@ -108,6 +110,7 @@ if resource is not None:\n <string>_getattr_</string> <string>resource</string> <string>None</string> + <string>movement_use</string> </tuple> </value> </item> diff --git a/bt5/erp5_base/bt/change_log b/bt5/erp5_base/bt/change_log index 2a3ce6c923..0ff4908ce8 100644 --- a/bt5/erp5_base/bt/change_log +++ b/bt5/erp5_base/bt/change_log @@ -1,3 +1,6 @@ +2010-09-28 tatuya +* Stop overwriting a value by movement_resource_interaraction_workflow when the categories are already set a valid value as the new resource. + 2010-09-28 tatuya * Previous commits(r38692,38707) were not solved the issue that movement_resource_interaction_workflow prevents the delivery buliding. So, revert them. diff --git a/bt5/erp5_base/bt/revision b/bt5/erp5_base/bt/revision index 0aa5559ec4..bbff031a29 100644 --- a/bt5/erp5_base/bt/revision +++ b/bt5/erp5_base/bt/revision @@ -1 +1 @@ -866 \ No newline at end of file +867 \ No newline at end of file -- 2.30.9