[FIX] purchase: PO state when validated
When nothing has been invoiced and the PO is validated with nothing to invoice then the state of the PO must be "Nothing to invoice" opw:769919
This commit is contained in:
@@ -57,7 +57,7 @@ class PurchaseOrder(models.Model):
|
||||
|
||||
if any(float_compare(line.qty_invoiced, line.product_qty if line.product_id.purchase_method == 'purchase' else line.qty_received, precision_digits=precision) == -1 for line in order.order_line):
|
||||
order.invoice_status = 'to invoice'
|
||||
elif all(float_compare(line.qty_invoiced, line.product_qty if line.product_id.purchase_method == 'purchase' else line.qty_received, precision_digits=precision) >= 0 for line in order.order_line):
|
||||
elif all(float_compare(line.qty_invoiced, line.product_qty if line.product_id.purchase_method == 'purchase' else line.qty_received, precision_digits=precision) >= 0 for line in order.order_line) and order.invoice_ids:
|
||||
order.invoice_status = 'invoiced'
|
||||
else:
|
||||
order.invoice_status = 'no'
|
||||
|
||||
Reference in New Issue
Block a user