[IMP] sale: Set Invoice status to Ìnvoice if invoice qty >= ordered qty

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"
This commit is contained in:
Yannick Tivisse
2017-08-01 14:39:51 +02:00
parent b624403956
commit c854de4999
+1 -1
View File
@@ -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: