Commit 7538b2ca authored by Jérome Perrin's avatar Jérome Perrin

simplify code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16403 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8bba2451
...@@ -101,8 +101,7 @@ class BalanceTransaction(AccountingTransaction, Inventory): ...@@ -101,8 +101,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
"""Returns movements that implies only grouping by node.""" """Returns movements that implies only grouping by node."""
movement_list = [] movement_list = []
for movement in self.getMovementList(): for movement in self.getMovementList():
if not getattr(movement, 'isAccountable', 1): if getattr(movement, 'isAccountable', 1):
continue
if not (movement.getSourceSection() or if not (movement.getSourceSection() or
movement.getDestinationPayment()): movement.getDestinationPayment()):
movement_list.append(movement) movement_list.append(movement)
...@@ -112,8 +111,7 @@ class BalanceTransaction(AccountingTransaction, Inventory): ...@@ -112,8 +111,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
"""Returns movements that implies grouping by node and payment""" """Returns movements that implies grouping by node and payment"""
movement_list = [] movement_list = []
for movement in self.getMovementList(): for movement in self.getMovementList():
if not getattr(movement, 'isAccountable', 1): if getattr(movement, 'isAccountable', 1):
continue
if movement.getDestinationPayment(): if movement.getDestinationPayment():
movement_list.append(movement) movement_list.append(movement)
return movement_list return movement_list
...@@ -122,8 +120,7 @@ class BalanceTransaction(AccountingTransaction, Inventory): ...@@ -122,8 +120,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
"""Returns movements that implies only grouping by node and mirror section""" """Returns movements that implies only grouping by node and mirror section"""
movement_list = [] movement_list = []
for movement in self.getMovementList(): for movement in self.getMovementList():
if not getattr(movement, 'isAccountable', 1): if getattr(movement, 'isAccountable', 1):
continue
if movement.getSourceSection(): if movement.getSourceSection():
movement_list.append(movement) movement_list.append(movement)
return movement_list return movement_list
...@@ -395,8 +392,7 @@ class BalanceTransaction(AccountingTransaction, Inventory): ...@@ -395,8 +392,7 @@ class BalanceTransaction(AccountingTransaction, Inventory):
add_obj(temp_object_factory(**diff)) add_obj(temp_object_factory(**diff))
# Catalog this transaction as a standard document # Catalog this transaction as a standard document
object_list = [self] self.portal_catalog.catalogObjectList([self])
self.portal_catalog.catalogObjectList(object_list)
# Catalog differences calculated from lines # Catalog differences calculated from lines
self.portal_catalog.catalogObjectList(stock_object_list, self.portal_catalog.catalogObjectList(stock_object_list,
......
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