Commit e421de77 authored by Jérome Perrin's avatar Jérome Perrin Committed by Xiaowu Zhang

pdm/trade: Support supply line for a product_line

A supply line defined for a product line will apply to all resources
member of this product line.

(cherry picked from commit 3751610a)
Conflicts:
	bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/PurchaseSupplyLine_view.xml
parent 30b5aec5
...@@ -66,6 +66,9 @@ if context.getSource():\n ...@@ -66,6 +66,9 @@ if context.getSource():\n
if context.getDestination():\n if context.getDestination():\n
base_category_tuple += (\'destination\',)\n base_category_tuple += (\'destination\',)\n
\n \n
if context.hasProductLine():\n
base_category_tuple += (\'product_line\', )\n
\n
if context.getParentValue().getParentValue().getPortalType() in (\n if context.getParentValue().getParentValue().getPortalType() in (\n
## XXX There is no portal type group for trade conditions.\n ## XXX There is no portal type group for trade conditions.\n
\'Sale Trade Condition\',\n \'Sale Trade Condition\',\n
......
...@@ -68,6 +68,9 @@ if context.getSource():\n ...@@ -68,6 +68,9 @@ if context.getSource():\n
if context.getDestination():\n if context.getDestination():\n
base_category_tuple += (\'destination\',)\n base_category_tuple += (\'destination\',)\n
\n \n
if context.hasProductLine():\n
base_category_tuple += (\'product_line\', )\n
\n
if context.getParentValue().getPortalType() in (\n if context.getParentValue().getPortalType() in (\n
## XXX There is no portal type group for trade conditions.\n ## XXX There is no portal type group for trade conditions.\n
\'Sale Trade Condition\',\n \'Sale Trade Condition\',\n
......
...@@ -178,6 +178,10 @@ if specialise_set:\n ...@@ -178,6 +178,10 @@ if specialise_set:\n
kw[\'categories\'] = kw.get(\'categories\', []) + [\'specialise/%s\' % x for x in specialise_set]\n kw[\'categories\'] = kw.get(\'categories\', []) + [\'specialise/%s\' % x for x in specialise_set]\n
\n \n
if resource is not None:\n if resource is not None:\n
product_line = resource.getProductLine()\n
if product_line:\n
kw[\'categories\'] = kw.get(\'categories\', []) + [\'product_line/%s\' % product_line]\n
\n
if isPricingOptimise():\n if isPricingOptimise():\n
return getOptimisedPriceCalculationOperandDict(default=default, context=context, **kw)\n return getOptimisedPriceCalculationOperandDict(default=default, context=context, **kw)\n
else:\n else:\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment