Commit 0b638d4b authored by Fabien Morin's avatar Fabien Morin

- remove some unused imports

- after updateAggregatedAmountList, if some lines don't have movmenent, remove them


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eb1cd246
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.Invoice import Invoice from Products.ERP5.Document.Invoice import Invoice
from Products.ERP5Type.Utils import cartesianProduct
from zLOG import LOG, DEBUG, INFO
#XXX TODO: review naming of new methods #XXX TODO: review naming of new methods
#XXX WARNING: current API naming may change although model should be stable. #XXX WARNING: current API naming may change although model should be stable.
...@@ -157,7 +155,7 @@ class PaySheetTransaction(Invoice): ...@@ -157,7 +155,7 @@ class PaySheetTransaction(Invoice):
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'applyTransformation') 'applyTransformation')
def applyTransformation(self): def applyTransformation(self):
'''use a delivery builder to create all the paysheet lines using '''use a delivery builder to create all the paysheet lines using
movements return by updateAggregatedAmountList movements return by updateAggregatedAmountList
''' '''
portal = self.getPortalObject() portal = self.getPortalObject()
...@@ -166,6 +164,9 @@ class PaySheetTransaction(Invoice): ...@@ -166,6 +164,9 @@ class PaySheetTransaction(Invoice):
for movement in movement_dict['movement_to_delete_list']: for movement in movement_dict['movement_to_delete_list']:
parent = movement.getParentValue() parent = movement.getParentValue()
parent.manage_delObjects(movement.getId()) parent.manage_delObjects(movement.getId())
if len(parent.contentValues(portal_type='Pay Sheet Cell')) == 0:
# the line contain no movements, remove it
self.manage_delObjects(parent.getId())
business_process_list = paysheet_model.findSpecialiseValueList(\ business_process_list = paysheet_model.findSpecialiseValueList(\
context=paysheet_model, context=paysheet_model,
portal_type_list=['Business Process']) portal_type_list=['Business Process'])
......
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