From 06db34a7d7e8375f556031ee1dc22546480d47c1 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Mon, 24 Jul 2017 13:24:03 +0200 Subject: [PATCH] [FIX] test for refund base on amount total not amount untaxed --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 7b81e63121307..a58a6c090c4cb 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -340,7 +340,7 @@ def action_invoice_create(self, grouped=False, final=False): if not invoice.invoice_line_ids: raise UserError(_('There is no invoicable line.')) # If invoice is negative, do a refund invoice instead - if invoice.amount_untaxed < 0: + if invoice.amount_total < 0: invoice.type = 'out_refund' for line in invoice.invoice_line_ids: line.quantity = -line.quantity