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: {
|
||||
part_detail: true,
|
||||
manufacturer_detail: true,
|
||||
}
|
||||
},
|
||||
},
|
||||
description: {},
|
||||
link: {
|
||||
@ -108,6 +108,33 @@ function createSupplierPart(options={}) {
|
||||
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" %}', {
|
||||
fields: fields,
|
||||
method: 'POST',
|
||||
|
Loading…
Reference in New Issue
Block a user