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 @@ -90,11 +90,29 @@ def _recalculate_move_lines(
9090 for move_line in move_lines :
9191 ml_id = move_line ["id" ]
9292 if ml_id in debit_ids :
93- move_line ["amount_residual" ] += debit_amount [ml_id ]
94- move_line ["amount_residual_currency" ] += debit_amount_currency [ml_id ]
93+ if move_line .get ("amount_residual" , False ):
94+ move_line ["amount_residual" ] += debit_amount [ml_id ]
95+ else :
96+ move_line ["amount_residual" ] = debit_amount [ml_id ]
97+ if move_line .get ("amount_residual_currency" , False ):
98+ move_line ["amount_residual_currency" ] += debit_amount_currency [
99+ ml_id
100+ ]
101+ else :
102+ move_line ["amount_residual_currency" ] = debit_amount_currency [ml_id ]
95103 if ml_id in credit_ids :
96- move_line ["amount_residual_currency" ] += credit_amount_currency [ml_id ]
97- move_line ["amount_residual" ] -= credit_amount [ml_id ]
104+ if move_line .get ("amount_residual" , False ):
105+ move_line ["amount_residual" ] -= credit_amount [ml_id ]
106+ else :
107+ move_line ["amount_residual" ] = - credit_amount [ml_id ]
108+ if move_line .get ("amount_residual_currency" , False ):
109+ move_line ["amount_residual_currency" ] -= credit_amount_currency [
110+ ml_id
111+ ]
112+ else :
113+ move_line ["amount_residual_currency" ] = - credit_amount_currency [
114+ ml_id
115+ ]
98116 return move_lines
99117
100118 def _get_accounts_data (self , accounts_ids ):
You can’t perform that action at this time.
0 commit comments