Commit 092207f6 authored by Fabien Morin's avatar Fabien Morin

the way to remove movement that should not be created was wrong. Using the...

the way to remove movement that should not be created was wrong. Using the reference of movement to find corresponding model_line and remove the movements of the model lines that should not be created is better.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27692 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 27c86136
...@@ -232,14 +232,21 @@ class TradeCondition(Path, Transformation, XMLMatrix): ...@@ -232,14 +232,21 @@ class TradeCondition(Path, Transformation, XMLMatrix):
movement_list=movement_list, movement_list=movement_list,
current_aggregated_amount_list=result, current_aggregated_amount_list=result,
**kw) **kw)
if model_line.getCreateLine(): result.extend(model_line_result)
# remove movement that should not be created
result.extend(model_line_result)
if len(result) != len(movement_list): if len(result) != len(movement_list):
# something was added # something was added
need_to_run = 1 need_to_run = 1
movement_list = result movement_list = result
return result
# remove movement that should not be created
movement_list = []
for movement in result:
movement_ref = movement.getReference()
for model_line in trade_model_line_composed_list:
if model_line.getReference() == movement_ref and\
model_line.isCreateLine():
movement_list.append(movement)
return movement_list
security.declareProtected( Permissions.AccessContentsInformation, 'getCell') security.declareProtected( Permissions.AccessContentsInformation, 'getCell')
def getCell(self, *kw , **kwd): def getCell(self, *kw , **kwd):
......
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