Commit e2fc005 1 parent de5d4cc commit e2fc005 Copy full SHA for e2fc005
File tree 1 file changed +7
-3
lines changed
account_payment_pro/models
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -506,9 +506,13 @@ def action_post_and_new(self):
506
506
def _compute_selected_debt (self ):
507
507
for rec in self :
508
508
# factor = 1
509
- rec .selected_debt = sum (rec .to_pay_move_line_ids ._origin .mapped ("amount_residual" )) * (
510
- - 1.0 if rec .partner_type == "supplier" else 1.0
511
- )
509
+ amount_residual = sum (rec .to_pay_move_line_ids ._origin .mapped ("amount_residual" ))
510
+ if self .env .context .get ("pay_now" ) and amount_residual != sum (
511
+ rec .to_pay_move_line_ids ._origin .mapped ("amount_residual_currency" )
512
+ ):
513
+ amount_residual = sum (rec .to_pay_move_line_ids ._origin .mapped ("amount_residual_currency" ))
514
+ rec .selected_debt = amount_residual * (- 1.0 if rec .partner_type == "supplier" else 1.0 )
515
+
512
516
# TODO error en la creacion de un payment desde el menu?
513
517
# if rec.payment_type == 'outbound' and rec.partner_type == 'customer' or \
514
518
# rec.payment_type == 'inbound' and rec.partner_type == 'supplier':
You can’t perform that action at this time.
0 commit comments