Commit 618b35a7 authored by Jérome Perrin's avatar Jérome Perrin

Revert "pdm/trade: Support supply line for a product_line"

This reverts commit 4f0bdaab.
parent 4f0bdaab
......@@ -66,9 +66,6 @@ if context.getSource():\n
if context.getDestination():\n
base_category_tuple += (\'destination\',)\n
\n
if context.hasProductLine():\n
base_category_tuple += (\'product_line\', )\n
\n
if context.getParentValue().getParentValue().getPortalType() in (\n
## XXX There is no portal type group for trade conditions.\n
\'Sale Trade Condition\',\n
......
......@@ -68,9 +68,6 @@ if context.getSource():\n
if context.getDestination():\n
base_category_tuple += (\'destination\',)\n
\n
if context.hasProductLine():\n
base_category_tuple += (\'product_line\', )\n
\n
if context.getParentValue().getPortalType() in (\n
## XXX There is no portal type group for trade conditions.\n
\'Sale Trade Condition\',\n
......
......@@ -178,10 +178,6 @@ if specialise_set:\n
kw[\'categories\'] = kw.get(\'categories\', []) + [\'specialise/%s\' % x for x in specialise_set]\n
\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
return getOptimisedPriceCalculationOperandDict(default=default, context=context, **kw)\n
else:\n
......
......@@ -186,16 +186,6 @@ class TestResource(ERP5TypeTestCase):
quantity=0.001)
gram_definition.validate()
# create some product line categories
product_line = self.portal.portal_categories.product_line
if product_line._getOb('a', None) is None:
product_line.newContent(
id='a',
portal_type='Category')
if product_line._getOb('b', None) is None:
product_line.newContent(
id='b',
portal_type='Category')
def stepCreateResource(self, sequence=None, sequence_list=None, **kw):
"""
......@@ -1077,43 +1067,6 @@ class TestResource(ERP5TypeTestCase):
self.assertEqual(1000, sale_order_line.getPrice())
self.assertEqual(5000, sale_order_line.getTotalPrice())
def testGetPriceProductLine(self):
"""Test supply line set for a product line.
"""
# This supply line defines a price applicable for all resources member
# of product line a
supply = self.portal.getDefaultModule(self.sale_supply_portal_type).newContent(
portal_type=self.sale_supply_portal_type)
supply_line = supply.newContent(portal_type=self.sale_supply_line_portal_type)
supply_line.setProductLineValue(self.portal.portal_categories.product_line.a)
supply_line.setBasePrice(1000)
supply.validate()
resource_a = self.portal.getDefaultModule(self.product_portal_type)\
.newContent(portal_type=self.product_portal_type)
resource_a.setProductLineValue(self.portal.portal_categories.product_line.a)
resource_b = self.portal.getDefaultModule(self.product_portal_type)\
.newContent(portal_type=self.product_portal_type)
resource_b.setProductLineValue(self.portal.portal_categories.product_line.b)
self.tic()
sale_order_line = self.portal.getDefaultModule("Sale Order").newContent(
portal_type='Sale Order').newContent(
portal_type=self.sale_order_line_portal_type,
resource_value=resource_a,
quantity=1)
# resource_a is member of product_line/a, so our supply line applies.
self.assertEqual(1000, sale_order_line.getPrice())
sale_order_line = self.portal.getDefaultModule("Sale Order").newContent(
portal_type='Sale Order').newContent(
portal_type=self.sale_order_line_portal_type,
resource_value=resource_b,
quantity=1)
# resource_b is member of product_line/b, so our supply line does not apply.
self.assertEqual(None, sale_order_line.getPrice())
def testQuantityPrecision(self):
"""test how to define quantity precision on resources.
"""
......
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