Commit a0fbd25e authored by Sebastien Robin's avatar Sebastien Robin

make sure to give activate_kw parameter to all new created objects


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4500 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92a5e463
...@@ -284,12 +284,14 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -284,12 +284,14 @@ class OrderBuilder(XMLObject, Amount, Predicate):
movement_group, movement_group,
self.getDeliveryCollectOrderList(), self.getDeliveryCollectOrderList(),
{}, {},
delivery_to_update_list=delivery_to_update_list) delivery_to_update_list=delivery_to_update_list,
**kw)
return delivery_list return delivery_list
def _deliveryGroupProcessing(self, delivery_module, movement_group, def _deliveryGroupProcessing(self, delivery_module, movement_group,
collect_order_list, property_dict, collect_order_list, property_dict,
delivery_to_update_list=None): delivery_to_update_list=None,
activate_kw=None,**kw):
""" """
Build empty delivery from a list of movement Build empty delivery from a list of movement
""" """
...@@ -308,7 +310,8 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -308,7 +310,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
group, group,
collect_order_list[1:], collect_order_list[1:],
property_dict.copy(), property_dict.copy(),
delivery_to_update_list=delivery_to_update_list) delivery_to_update_list=delivery_to_update_list,
activate_kw=activate_kw)
delivery_list.extend(new_delivery_list) delivery_list.extend(new_delivery_list)
else: else:
# Test if we can update a existing delivery, or if we need to create # Test if we can update a existing delivery, or if we need to create
...@@ -327,7 +330,8 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -327,7 +330,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery = delivery_module.newContent( delivery = delivery_module.newContent(
portal_type=self.getDeliveryPortalType(), portal_type=self.getDeliveryPortalType(),
id=new_delivery_id, id=new_delivery_id,
bypass_init_script=1) bypass_init_script=1,
activate_kw=activate_kw,**kw)
# Put properties on delivery # Put properties on delivery
delivery.edit(**property_dict) delivery.edit(**property_dict)
...@@ -337,13 +341,15 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -337,13 +341,15 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery, delivery,
group, group,
self.getDeliveryLineCollectOrderList()[1:], self.getDeliveryLineCollectOrderList()[1:],
{}) {},
activate_kw=activate_kw,**kw)
delivery_list.append(delivery) delivery_list.append(delivery)
return delivery_list return delivery_list
def _deliveryLineGroupProcessing(self, delivery, movement_group, def _deliveryLineGroupProcessing(self, delivery, movement_group,
collect_order_list, property_dict, collect_order_list, property_dict,
update_requested=0): update_requested=0,
activate_kw=None,**kw):
""" """
Build delivery line from a list of movement on a delivery Build delivery line from a list of movement on a delivery
""" """
...@@ -355,7 +361,7 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -355,7 +361,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
for group in movement_group.getGroupList(): for group in movement_group.getGroupList():
self._deliveryLineGroupProcessing( self._deliveryLineGroupProcessing(
delivery, group, collect_order_list[1:], property_dict.copy(), delivery, group, collect_order_list[1:], property_dict.copy(),
update_requested=update_requested) update_requested=update_requested,activate_kw=activate_kw)
else: else:
# Test if we can update an existing line, or if we need to create a new # Test if we can update an existing line, or if we need to create a new
# one # one
...@@ -374,7 +380,8 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -374,7 +380,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
delivery_line = delivery.newContent( delivery_line = delivery.newContent(
portal_type=self.getDeliveryLinePortalType(), portal_type=self.getDeliveryLinePortalType(),
id=new_delivery_line_id, id=new_delivery_line_id,
variation_category_list=[]) variation_category_list=[],
activate_kw=activate_kw)
# Put properties on delivery line # Put properties on delivery line
delivery_line.edit(**property_dict) delivery_line.edit(**property_dict)
# Update variation category list on line # Update variation category list on line
...@@ -399,19 +406,21 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -399,19 +406,21 @@ class OrderBuilder(XMLObject, Amount, Predicate):
group, group,
self.getDeliveryCellCollectOrderList()[1:], self.getDeliveryCellCollectOrderList()[1:],
{}, {},
update_existing_line=update_existing_line) update_existing_line=update_existing_line,
activate_kw=activate_kw)
else: else:
self._deliveryCellGroupProcessing( self._deliveryCellGroupProcessing(
delivery_line, delivery_line,
movement_group, movement_group,
[], [],
{}, {},
update_existing_line=update_existing_line) update_existing_line=update_existing_line,
activate_kw=activate_kw)
def _deliveryCellGroupProcessing(self, delivery_line, movement_group, def _deliveryCellGroupProcessing(self, delivery_line, movement_group,
collect_order_list, property_dict, collect_order_list, property_dict,
update_existing_line=0): update_existing_line=0,activate_kw=None):
""" """
Build delivery cell from a list of movement on a delivery line Build delivery cell from a list of movement on a delivery line
or complete delivery line or complete delivery line
...@@ -427,7 +436,8 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -427,7 +436,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
group, group,
collect_order_list[1:], collect_order_list[1:],
property_dict.copy(), property_dict.copy(),
update_existing_line=update_existing_line) update_existing_line=update_existing_line,
activate_kw=activate_kw)
else: else:
movement_list = movement_group.getMovementList() movement_list = movement_group.getMovementList()
if len(movement_list) != 1: if len(movement_list) != 1:
...@@ -468,7 +478,8 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -468,7 +478,8 @@ class OrderBuilder(XMLObject, Amount, Predicate):
omit_option_base_category=1) omit_option_base_category=1)
if not delivery_line.hasCell(base_id=base_id, *cell_key): if not delivery_line.hasCell(base_id=base_id, *cell_key):
cell = delivery_line.newCell(base_id=base_id, \ cell = delivery_line.newCell(base_id=base_id, \
portal_type=self.getDeliveryCellPortalType(), *cell_key) portal_type=self.getDeliveryCellPortalType(),
activate_kw=activate_kw,*cell_key)
vcl = movement.getVariationCategoryList() vcl = movement.getVariationCategoryList()
cell._edit(category_list=vcl, cell._edit(category_list=vcl,
# XXX hardcoded value # XXX hardcoded value
......
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