From c854de49999f9124ee9613ceb415ba30b36a7f45 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 1 Aug 2017 14:28:26 +0200 Subject: [PATCH] =?UTF-8?q?[IMP]=20sale:=20Set=20`Invoice=20status`=20to?= =?UTF-8?q?=20`=C3=8Cnvoice`=20if=20invoice=20qty=20>=3D=20ordered=20qty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PURPOSE ======= Clarify the invoice status on the sales orders. SPECIFICATION ============= If you have invoiced more than the required quantities and, the invoice status of the sales order should be "Fully Invoiced" and not "to invoice" --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 5299868d2ca..af6f3a002bf 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -585,7 +585,7 @@ class SaleOrderLine(models.Model): for line in self: if line.state not in ('sale', 'done'): line.invoice_status = 'no' - elif not float_is_zero(line.qty_to_invoice, precision_digits=precision): + elif float_compare(line.qty_to_invoice, 0.0, precision_digits=precision) == 1: line.invoice_status = 'to invoice' elif line.state == 'sale' and line.product_id.invoice_policy == 'order' and\ float_compare(line.qty_delivered, line.product_uom_qty, precision_digits=precision) == 1: