mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add secondary field options for "Create Supplier Part" form
- Supplier - Manufacturer Part
This commit is contained in:
parent
b960ce839a
commit
94c1ed882f
@ -72,7 +72,7 @@ function supplierPartFields() {
|
|||||||
filters: {
|
filters: {
|
||||||
part_detail: true,
|
part_detail: true,
|
||||||
manufacturer_detail: true,
|
manufacturer_detail: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
description: {},
|
description: {},
|
||||||
link: {
|
link: {
|
||||||
@ -108,6 +108,33 @@ function createSupplierPart(options={}) {
|
|||||||
fields.manufacturer_part.value = options.manufacturer_part;
|
fields.manufacturer_part.value = options.manufacturer_part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add a secondary modal for the supplier
|
||||||
|
fields.supplier.secondary = {
|
||||||
|
title: '{% trans "Add Supplier" %}',
|
||||||
|
fields: function(data) {
|
||||||
|
var company_fields = companyFormFields();
|
||||||
|
|
||||||
|
company_fields.is_supplier.value = true;
|
||||||
|
|
||||||
|
return company_fields;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add a secondary modal for the manufacturer part
|
||||||
|
fields.manufacturer_part.secondary = {
|
||||||
|
title: '{% trans "Add Manufacturer Part" %}',
|
||||||
|
fields: function(data) {
|
||||||
|
var mp_fields = manufacturerPartFields();
|
||||||
|
|
||||||
|
if (data.part) {
|
||||||
|
mp_fields.part.value = data.part;
|
||||||
|
mp_fields.part.hidden = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mp_fields;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
constructForm('{% url "api-supplier-part-list" %}', {
|
constructForm('{% url "api-supplier-part-list" %}', {
|
||||||
fields: fields,
|
fields: fields,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user