From 92275f51aea4ad52555b8cedbf12ff7d8dd4b84a Mon Sep 17 00:00:00 2001 From: Alexandre Boeglin <alex@nexedi.com> Date: Tue, 12 Feb 2008 16:13:18 +0000 Subject: [PATCH] in SupplyLine_asPredicate and SupplyLine_asPredicate, deal with both source and destination. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19279 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_trade/SupplyCell_asPredicate.xml | 14 +++++++++----- .../erp5_trade/SupplyLine_asPredicate.xml | 14 +++++++++----- bt5/erp5_trade/bt/revision | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyCell_asPredicate.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyCell_asPredicate.xml index 0955497433..750b375f5d 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyCell_asPredicate.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyCell_asPredicate.xml @@ -65,11 +65,14 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>if context.getDestinationValue() is None:\n - return context.generatePredicate(membership_criterion_base_category_list = (\'resource\',),\n - criterion_property_list = (\'start_date\',))\n + <value> <string>base_category_tuple = (\'resource\',)\n \n -return context.generatePredicate(membership_criterion_base_category_list = (\'destination\', \'resource\'),\n +if context.getSource():\n + base_category_tuple += (\'source\',)\n +if context.getDestination():\n + base_category_tuple += (\'destination\',)\n +\n +return context.generatePredicate(membership_criterion_base_category_list = base_category_tuple,\n criterion_property_list = (\'start_date\',))\n </string> </value> </item> @@ -121,9 +124,10 @@ return context.generatePredicate(membership_criterion_base_category_list = (\'de <tuple> <string>args</string> <string>kw</string> + <string>base_category_tuple</string> <string>_getattr_</string> <string>context</string> - <string>None</string> + <string>_inplacevar_</string> </tuple> </value> </item> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asPredicate.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asPredicate.xml index 1ed7252c57..544a0b674f 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asPredicate.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asPredicate.xml @@ -65,11 +65,14 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>if context.getDestinationValue() is None:\n - return context.generatePredicate(membership_criterion_base_category_list = (\'resource\',),\n - criterion_property_list = (\'start_date\',))\n + <value> <string>base_category_tuple = (\'resource\',)\n \n -return context.generatePredicate(membership_criterion_base_category_list = (\'destination\', \'resource\'),\n +if context.getSource():\n + base_category_tuple += (\'source\',)\n +if context.getDestination():\n + base_category_tuple += (\'destination\',)\n +\n +return context.generatePredicate(membership_criterion_base_category_list = base_category_tuple,\n criterion_property_list = (\'start_date\',))\n </string> </value> </item> @@ -115,9 +118,10 @@ return context.generatePredicate(membership_criterion_base_category_list = (\'de <tuple> <string>args</string> <string>kw</string> + <string>base_category_tuple</string> <string>_getattr_</string> <string>context</string> - <string>None</string> + <string>_inplacevar_</string> </tuple> </value> </item> diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 12e2555919..a5b5e0f805 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -177 \ No newline at end of file +181 \ No newline at end of file -- 2.30.9