Merge branch 'inventree:master' into workflow-remaster

This commit is contained in:
Matthias Mair 2021-12-02 17:13:49 +01:00 committed by GitHub
commit ec3b5b6cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -40,8 +40,8 @@
<link rel="stylesheet" href="{% static 'bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css' %}">
<link rel="stylesheet" href="{% static 'bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.css' %}">
<link rel='stylesheet' href='{% static "treegrid/css/jquery.treegrid.css" %}'>
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}">
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}">
<link rel="stylesheet" href="{% static 'fontawesome/css/brands.min.css' %}">
<link rel="stylesheet" href="{% static 'fontawesome/css/solid.min.css' %}">
<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}">
<link rel="stylesheet" href="{% static 'select2/css/select2-bootstrap-5-theme.css' %}">
<link rel="stylesheet" href="{% static 'fullcalendar/main.css' %}">

View File

@ -153,12 +153,7 @@ function partFields(options={}) {
delete fields['default_expiry'];
}
// Additional fields when "creating" a new part
if (options.create) {
// No supplier parts available yet
delete fields['default_supplier'];
if (options.create || options.duplicate) {
if (global_settings.PART_CREATE_INITIAL) {
fields.initial_stock = {
@ -187,6 +182,13 @@ function partFields(options={}) {
group: 'create',
};
}
}
// Additional fields when "creating" a new part
if (options.create) {
// No supplier parts available yet
delete fields['default_supplier'];
fields.copy_category_parameters = {
type: 'boolean',
@ -349,6 +351,10 @@ function duplicatePart(pk, options={}) {
duplicate: pk,
});
if (fields.initial_stock_location) {
fields.initial_stock_location.value = data.default_location;
}
// Remove "default_supplier" field
delete fields['default_supplier'];