Merge pull request #2464 from SchrodingersGat/po-receive-fix

Hide "receive parts" button for orders which have been cancelled
This commit is contained in:
Oliver 2021-12-20 11:56:31 +11:00 committed by GitHub
commit f92600501a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -871,7 +871,7 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) {
if (row.received >= row.quantity) {
// Already recevied
return `<span class='badge bg-success rounded-pill'>{% trans "Received" %}</span>`;
} else {
} else if (row.order_detail && row.order_detail.status == {{ PurchaseOrderStatus.PLACED }}) {
var html = `<div class='btn-group' role='group'>`;
var pk = row.pk;
@ -879,6 +879,8 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) {
html += `</div>`;
return html;
} else {
return '';
}
}
}