diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asCellRange.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asCellRange.xml index 78587a22defe9136a09fc4521d1050ffe7718a82..8c510513e54faa408d7afabaae845c6beaffc314 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asCellRange.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SupplyLine_asCellRange.xml @@ -70,6 +70,9 @@ <key> <string>_body</string> </key> <value> <string encoding="cdata"><![CDATA[ +portal = context.getPortalObject()\n +N_ = portal.Base_translateString\n +\n cell_range = []\n add_predicate = 1\n \n @@ -139,7 +142,28 @@ if add_predicate == 1:\n price_parameter = price_parameter[len(option_base_id_begin_with):]\n predicate_list = context.getQuantityPredicateValueList(price_parameter)\n if matrixbox == 1:\n - pred_ids = [(x.getRelativeUrl(), x.getTitle()) for x in predicate_list]\n +# pred_ids = [(x.getRelativeUrl(), x.getTitle()) for x in predicate_list]\n + # Translate the matrixbox ranges\n + pred_ids = []\n + for predicate in predicate_list:\n + predicate_criterion_list = predicate.getCriterionList()\n + predicate_title = \'\'\n + for criterion in predicate_criterion_list:\n + if criterion.property == \'quantity\':\n + min_qty = criterion.min\n + max_qty = criterion.max\n + if min_qty is None:\n + predicate_title = N_("Quantity < ${max_quantity}",\n + mapping={\'max_quantity\': max_qty})\n + elif max_qty is None:\n + predicate_title = N_("${min_quantity} <= Quantity",\n + mapping={\'min_quantity\': min_qty})\n + else:\n + predicate_title = N_("${min_quantity} <= Quantity < ${max_quantity}",\n + mapping={\'min_quantity\': min_qty,\n + \'max_quantity\': max_qty})\n + break\n + pred_ids.append((predicate.getRelativeUrl(), predicate_title))\n else:\n pred_ids = [x.getRelativeUrl() for x in predicate_list]\n # Insert predicat list for display in columns\n @@ -169,6 +193,12 @@ return cell_range\n <none/> </value> </item> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> <item> <key> <string>_params</string> </key> <value> <string>base_id=\'path\', matrixbox=0, display_base_category=1, option_variation=0, **kw</string> </value> @@ -202,10 +232,12 @@ return cell_range\n <string>display_base_category</string> <string>option_variation</string> <string>kw</string> - <string>cell_range</string> - <string>add_predicate</string> <string>_getattr_</string> <string>context</string> + <string>portal</string> + <string>N_</string> + <string>cell_range</string> + <string>add_predicate</string> <string>no_option_base_category_list</string> <string>base_category_list</string> <string>append</string> @@ -223,6 +255,13 @@ return cell_range\n <string>option_base_id_begin_with</string> <string>predicate_list</string> <string>pred_ids</string> + <string>predicate</string> + <string>predicate_criterion_list</string> + <string>predicate_title</string> + <string>criterion</string> + <string>min_qty</string> + <string>max_qty</string> + <string>None</string> </tuple> </value> </item> diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 25bf17fc5aaabd17402e77a2b16f95fbea7310d2..b5045cc4046dbc1d7cafa4c603fd3cdf35dc5dde 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -18 \ No newline at end of file +21 \ No newline at end of file diff --git a/bt5/erp5_trade/bt/short_title b/bt5/erp5_trade/bt/short_title new file mode 100644 index 0000000000000000000000000000000000000000..4af18322e32f3dd19579c80e26e4a306ad11e049 --- /dev/null +++ b/bt5/erp5_trade/bt/short_title @@ -0,0 +1 @@ +None \ No newline at end of file