Commit 4d978464 authored by Łukasz Nowak's avatar Łukasz Nowak

- do not allow to use more than one key in property dict in set of movement groups


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26180 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f98056fc
...@@ -40,6 +40,7 @@ from Acquisition import aq_parent, aq_inner ...@@ -40,6 +40,7 @@ from Acquisition import aq_parent, aq_inner
class CollectError(Exception): pass class CollectError(Exception): pass
class MatrixError(Exception): pass class MatrixError(Exception): pass
class DuplicatedPropertyDictKeysError(Exception): pass
class OrderBuilder(XMLObject, Amount, Predicate): class OrderBuilder(XMLObject, Amount, Predicate):
""" """
...@@ -259,7 +260,11 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -259,7 +260,11 @@ class OrderBuilder(XMLObject, Amount, Predicate):
property_dict = {} property_dict = {}
if not len(instance_list): if not len(instance_list):
for movement_group_node in movement_group_node_list: for movement_group_node in movement_group_node_list:
property_dict.update(movement_group_node.getGroupEditDict()) for k,v in movement_group_node.getGroupEditDict().iteritems():
if k in property_dict:
raise DuplicatedPropertyDictKeysError(k)
else:
property_dict[k] = v
else: else:
# we want to check the original delivery first. # we want to check the original delivery first.
# so sort instance_list by that current is exists or not. # so sort instance_list by that current is exists or not.
......
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