File tree Expand file tree Collapse file tree
sale_advance_payment/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,3 +401,33 @@ def test_04_refunds(self):
401401 self .sale_order_1 .amount_residual ,
402402 3600 ,
403403 )
404+
405+ def test_05_residual_amount_credit_note (self ):
406+ self .sale_order_1 .action_confirm ()
407+ self .sale_order_1 ._create_invoices ()
408+ invoice = self .sale_order_1 .invoice_ids [0 ]
409+ invoice .invoice_date = fields .Date .today ()
410+ invoice .action_post ()
411+ self .env ["account.payment.register" ].with_context (
412+ active_model = "account.move" , active_ids = invoice .ids
413+ ).create (
414+ {
415+ "amount" : 3600.0 ,
416+ "group_payment" : True ,
417+ "payment_difference_handling" : "open" ,
418+ }
419+ )._create_payments ()
420+ self .assertEqual (self .sale_order_1 .amount_residual , 0 )
421+ credit_note = invoice ._reverse_moves ()
422+ credit_note .invoice_date = fields .Date .today ()
423+ credit_note .action_post ()
424+ self .env ["account.payment.register" ].with_context (
425+ active_model = "account.move" , active_ids = credit_note .ids
426+ ).create (
427+ {
428+ "amount" : 3600.0 ,
429+ "group_payment" : True ,
430+ "payment_difference_handling" : "open" ,
431+ }
432+ )._create_payments ()
433+ self .assertEqual (self .sale_order_1 .amount_residual , 3600 )
You can’t perform that action at this time.
0 commit comments