Enable editing of "sales order" from build order

- Add a renderer for the sales order model
This commit is contained in:
Oliver 2021-10-07 10:45:14 +11:00
parent f610b5e171
commit 31665e3b8d
3 changed files with 23 additions and 1 deletions

View File

@ -43,7 +43,6 @@ function buildFormFields() {
}
},
sales_order: {
hidden: true,
},
batch: {},
target_date: {},

View File

@ -1568,6 +1568,9 @@ function renderModelData(name, model, data, parameters, options) {
case 'partparametertemplate':
renderer = renderPartParameterTemplate;
break;
case 'salesorder':
renderer = renderSalesOrder;
break;
case 'manufacturerpart':
renderer = renderManufacturerPart;
break;

View File

@ -216,6 +216,26 @@ function renderOwner(name, data, parameters, options) {
}
// Renderer for "SalesOrder" model
// eslint-disable-next-line no-unused-vars
function renderSalesOrder(name, data, parameters, options) {
var html = `<span>${data.reference}</span>`;
if (data.description) {
html += ` - <i>${data.description}</i>`;
}
html += `
<span class='float-right'>
<small>
{% trans "Order ID" %}: ${data.pk}
</small>
</span>`;
return html;
}
// Renderer for "PartCategory" model
// eslint-disable-next-line no-unused-vars
function renderPartCategory(name, data, parameters, options) {