diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml index 283ae794709acd3ad5123cce87c37400649c7cdf..beb666c93063ac5773fefa7522f20a5b8737b76b 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.xml @@ -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 diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 1143d3eeb285486e5888451faf12af44624b6d9c..0a678c620dae2f76754d5d2a6a2121a0ceb09a12 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -1080 \ No newline at end of file +1081 \ No newline at end of file