File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
account_financial_report/report Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,29 @@ def _recalculate_move_lines(
9595 for move_line in move_lines :
9696 ml_id = move_line ["id" ]
9797 if ml_id in debit_ids :
98- move_line ["amount_residual" ] += debit_amount [ml_id ]
99- move_line ["amount_residual_currency" ] += debit_amount_currency [ml_id ]
98+ if move_line .get ("amount_residual" , False ):
99+ move_line ["amount_residual" ] += debit_amount [ml_id ]
100+ else :
101+ move_line ["amount_residual" ] = debit_amount [ml_id ]
102+ if move_line .get ("amount_residual_currency" , False ):
103+ move_line ["amount_residual_currency" ] += debit_amount_currency [
104+ ml_id
105+ ]
106+ else :
107+ move_line ["amount_residual_currency" ] = debit_amount_currency [ml_id ]
100108 if ml_id in credit_ids :
101- move_line ["amount_residual_currency" ] += credit_amount_currency [ml_id ]
102- move_line ["amount_residual" ] -= credit_amount [ml_id ]
109+ if move_line .get ("amount_residual" , False ):
110+ move_line ["amount_residual" ] -= credit_amount [ml_id ]
111+ else :
112+ move_line ["amount_residual" ] = - credit_amount [ml_id ]
113+ if move_line .get ("amount_residual_currency" , False ):
114+ move_line ["amount_residual_currency" ] -= credit_amount_currency [
115+ ml_id
116+ ]
117+ else :
118+ move_line ["amount_residual_currency" ] = - credit_amount_currency [
119+ ml_id
120+ ]
103121 return move_lines
104122
105123 def _get_accounts_data (self , accounts_ids ):
You can’t perform that action at this time.
0 commit comments