Commit d04d3219 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Use XMLMatrix API where possible


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33482 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 77de576d
...@@ -311,22 +311,14 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -311,22 +311,14 @@ class TestProductionOrderMixin(TestOrderMixin):
""" """
transformation_transformed_resource = sequence.get('transformation_transformed_resource') transformation_transformed_resource = sequence.get('transformation_transformed_resource')
colour_count = size_count = 0
for colour in self.colour_list: for colour in self.colour_list:
for size in self.mrp_size_list: for size in self.mrp_size_list:
id = 'quantity_%s_%s'%(colour_count,size_count) quantity = self.colour_size_quantity_dict[colour][size]
transformation_transformed_resource.newContent( transformation_transformed_resource.newCell('colour/%s' % colour,
portal_type = 'Transformation Transformed Resource Cell', 'size/%s' % size,
id = id, quantity=quantity,
mapped_value_property_list = ('quantity',), base_id="quantity")
membership_criterion_base_category = ('colour', 'size'),
membership_criterion_category = ('colour/%s'%(colour,), 'size/%s'%(size,)),
quantity = self.colour_size_quantity_dict[colour][size],
)
size_count +=1
size_count = 0
colour_count +=1
def stepSetTransformationTransformedResourceVariationMatrix(self, sequence=None, sequence_list=None, def stepSetTransformationTransformedResourceVariationMatrix(self, sequence=None, sequence_list=None,
**kw): **kw):
...@@ -335,22 +327,14 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -335,22 +327,14 @@ class TestProductionOrderMixin(TestOrderMixin):
""" """
transformation_transformed_resource = sequence.get('transformation_transformed_resource') transformation_transformed_resource = sequence.get('transformation_transformed_resource')
colour_count = size_count = 0
for colour in self.colour_list: for colour in self.colour_list:
for size in self.mrp_size_list: for size in self.mrp_size_list:
id = 'variation_%s_%s'%(colour_count,size_count) variation_list = self.colour_size_variation_dict[colour][size]
transformation_transformed_resource.newContent( transformation_transformed_resource.newCell('colour/%s' % colour,
portal_type = 'Transformation Transformed Resource Cell', 'size/%s' % size,
id = id, categories = variation_list,
mapped_value_property_list = (), base_id="variation")
membership_criterion_base_category = ('colour', 'size'),
membership_criterion_category = ('colour/%s'%(colour,), 'size/%s'%(size,)),
categories = self.colour_size_variation_dict[colour][size],
)
size_count +=1
size_count = 0
colour_count +=1
def stepSetOrderLineQuantityMatrix(self, sequence=None, sequence_list=None, def stepSetOrderLineQuantityMatrix(self, sequence=None, sequence_list=None,
**kw): **kw):
...@@ -358,23 +342,14 @@ class TestProductionOrderMixin(TestOrderMixin): ...@@ -358,23 +342,14 @@ class TestProductionOrderMixin(TestOrderMixin):
Fills variation based quantity matrix Fills variation based quantity matrix
""" """
order_line = sequence.get('order_line') order_line = sequence.get('order_line')
colour_count = size_count = 0
for colour in self.colour_list: for colour in self.colour_list:
for size in self.mrp_size_list: for size in self.mrp_size_list:
id = 'movement_%s_%s'%(colour_count,size_count) order_line.newCell(
order_line.newContent( 'colour/%s' % colour,
portal_type = self.order_cell_portal_type, 'size/%s' % size,
id = id, quantity = self.order_line_colour_size_quantity_dict[colour][size],
mapped_value_property_list = ('quantity', 'price'), base_id="quantity",
membership_criterion_base_category = ('colour', 'size'),
membership_criterion_category = ('colour/%s'%(colour,), 'size/%s'%(size,)),
categories_list = ('colour/%s'%(colour,), 'size/%s'%(size,)),
quantity = self.order_line_colour_size_quantity_dict[colour][size]
) )
size_count +=1
size_count = 0
colour_count +=1
def stepSetOrderLineVariationCategories(self, sequence=None, sequence_list=None, def stepSetOrderLineVariationCategories(self, sequence=None, sequence_list=None,
**kw): **kw):
......
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