mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-09 07:00:56 +00:00
Create SupplierPart directly from PurchaseOrderLineItem dialog (#3361)
* Move JS code from html to external .js file * Add secondary dialog for creating a new SupplierPart from the PurchaseOrderLineItem dialog * JS linting
This commit is contained in:
@ -102,10 +102,14 @@ function editManufacturerPart(part, options={}) {
|
||||
}
|
||||
|
||||
|
||||
function supplierPartFields() {
|
||||
function supplierPartFields(options={}) {
|
||||
|
||||
return {
|
||||
part: {},
|
||||
var fields = {
|
||||
part: {
|
||||
filters: {
|
||||
purchaseable: true,
|
||||
}
|
||||
},
|
||||
manufacturer_part: {
|
||||
filters: {
|
||||
part_detail: true,
|
||||
@ -128,6 +132,12 @@ function supplierPartFields() {
|
||||
icon: 'fa-box',
|
||||
}
|
||||
};
|
||||
|
||||
if (options.part) {
|
||||
fields.manufacturer_part.filters.part = options.part;
|
||||
}
|
||||
|
||||
return fields;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -135,10 +145,11 @@ function supplierPartFields() {
|
||||
*/
|
||||
function createSupplierPart(options={}) {
|
||||
|
||||
var fields = supplierPartFields();
|
||||
var fields = supplierPartFields({
|
||||
part: options.part,
|
||||
});
|
||||
|
||||
if (options.part) {
|
||||
fields.manufacturer_part.filters.part = options.part;
|
||||
fields.part.hidden = true;
|
||||
fields.part.value = options.part;
|
||||
}
|
||||
|
Reference in New Issue
Block a user