[Erp5-report] r41336 jerome - in /erp5/trunk/bt5/erp5_trade: SkinTemplateItem/portal_skins/...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 10 15:52:43 CET 2010


Author: jerome
Date: Fri Dec 10 15:52:43 2010
New Revision: 41336

URL: http://svn.erp5.org?rev=41336&view=rev
Log:
give priority to trade conditions where both source and destintion section are from the same group

Modified:
    erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml
    erp5/trunk/bt5/erp5_trade/bt/revision

Modified: erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml?rev=41336&r1=41335&r2=41336&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml [utf8] Fri Dec 10 15:52:43 2010
@@ -78,8 +78,10 @@ else:\n
 \n
 def rank_method(trade_condition):\n
   rank = 0\n
+  destination_section_group = None\n
   destination_section = trade_condition.getDestinationSection()\n
   if destination_section:\n
+    destination_section_group = trade_condition.getDestinationSectionValue().getGroup()\n
     if destination_section == context.getDestinationSection():\n
       rank += 10\n
     else:\n
@@ -92,6 +94,13 @@ def rank_method(trade_condition):\n
       rank -= 2\n
   if trade_condition.getSourceSection():\n
     rank += 1\n
+    if destination_section_group:\n
+      source_section_group = trade_condition.getSourceSectionValue().getGroup()\n
+      if source_section_group:\n
+        if source_section_group.startswith(destination_section_group) \\\n
+             or destination_section_group.startswith(source_section_group):\n
+          # trade conditions where both sections are in the same group must have high priority\n
+          rank += 20\n
   if trade_condition.getSource():\n
     rank += 1\n
   rank += len(trade_condition.getSpecialiseList())\n

Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=41336&r1=41335&r2=41336&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision [utf8] Fri Dec 10 15:52:43 2010
@@ -1 +1 @@
-1080
\ No newline at end of file
+1081
\ No newline at end of file



More information about the Erp5-report mailing list