Commit af0c874f authored by Fabien Morin's avatar Fabien Morin

- add a check to not delete the paysheet in case where paysheet lines should be deleted

- add a condition to not return movement with 0 total_price


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27846 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a2e63cf1
...@@ -162,6 +162,7 @@ class PaySheetTransaction(Invoice): ...@@ -162,6 +162,7 @@ class PaySheetTransaction(Invoice):
movement_dict = paysheet_model.updateAggregatedAmountList(context=self) movement_dict = paysheet_model.updateAggregatedAmountList(context=self)
for movement in movement_dict['movement_to_delete_list']: for movement in movement_dict['movement_to_delete_list']:
parent = movement.getParentValue() parent = movement.getParentValue()
if parent.getPortalType() == 'Pay Sheet Line':
parent.manage_delObjects(movement.getId()) parent.manage_delObjects(movement.getId())
if len(parent.contentValues(portal_type='Pay Sheet Cell')) == 0: if len(parent.contentValues(portal_type='Pay Sheet Cell')) == 0:
# the line contain no movements, remove it # the line contain no movements, remove it
...@@ -176,6 +177,8 @@ class PaySheetTransaction(Invoice): ...@@ -176,6 +177,8 @@ class PaySheetTransaction(Invoice):
business_process = business_process_list[0] business_process = business_process_list[0]
movement_list_trade_phase_dic = {} movement_list_trade_phase_dic = {}
for movement in movement_dict['movement_to_add_list']: for movement in movement_dict['movement_to_add_list']:
if movement.getTotalPrice() != 0:
# remove movement with 0 total_price
trade_phase = movement.getTradePhase() trade_phase = movement.getTradePhase()
if not movement_list_trade_phase_dic.has_key(trade_phase): if not movement_list_trade_phase_dic.has_key(trade_phase):
movement_list_trade_phase_dic[trade_phase] = [] movement_list_trade_phase_dic[trade_phase] = []
......
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