mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree into plugin-2037
This commit is contained in:
commit
0daba629fe
@ -563,6 +563,7 @@
|
|||||||
.search-autocomplete-item {
|
.search-autocomplete-item {
|
||||||
border-top: 1px solid #EEE;
|
border-top: 1px solid #EEE;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
|
@ -131,13 +131,21 @@ function inventreeDocReady() {
|
|||||||
if ($('#search-bar').exists()) {
|
if ($('#search-bar').exists()) {
|
||||||
$('#search-bar').autocomplete({
|
$('#search-bar').autocomplete({
|
||||||
source: function(request, response) {
|
source: function(request, response) {
|
||||||
$.ajax({
|
|
||||||
url: '/api/part/',
|
var params = {
|
||||||
data: {
|
|
||||||
search: request.term,
|
search: request.term,
|
||||||
limit: user_settings.SEARCH_PREVIEW_RESULTS,
|
limit: user_settings.SEARCH_PREVIEW_RESULTS,
|
||||||
offset: 0
|
offset: 0,
|
||||||
},
|
};
|
||||||
|
|
||||||
|
if (user_settings.SEARCH_HIDE_INACTIVE_PARTS) {
|
||||||
|
// Limit to active parts
|
||||||
|
params.active = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/api/part/',
|
||||||
|
data: params,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
var transformed = $.map(data.results, function(el) {
|
var transformed = $.map(data.results, function(el) {
|
||||||
|
@ -1059,6 +1059,13 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
|
|||||||
'validator': bool,
|
'validator': bool,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'SEARCH_HIDE_INACTIVE_PARTS': {
|
||||||
|
'name': _("Hide Inactive Parts"),
|
||||||
|
'description': _('Hide inactive parts in search preview window'),
|
||||||
|
'default': False,
|
||||||
|
'validator': bool,
|
||||||
|
},
|
||||||
|
|
||||||
'PART_SHOW_QUANTITY_IN_FORMS': {
|
'PART_SHOW_QUANTITY_IN_FORMS': {
|
||||||
'name': _('Show Quantity in Forms'),
|
'name': _('Show Quantity in Forms'),
|
||||||
'description': _('Display available part quantity in some forms'),
|
'description': _('Display available part quantity in some forms'),
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_RESULTS" user_setting=True icon='fa-search' %}
|
{% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_RESULTS" user_setting=True icon='fa-search' %}
|
||||||
{% include "InvenTree/settings/setting.html" with key="SEARCH_SHOW_STOCK_LEVELS" user_setting=True icon='fa-boxes' %}
|
{% include "InvenTree/settings/setting.html" with key="SEARCH_SHOW_STOCK_LEVELS" user_setting=True icon='fa-boxes' %}
|
||||||
|
{% include "InvenTree/settings/setting.html" with key="SEARCH_HIDE_INACTIVE_PARTS" user_setting=True icon='fa-eye-slash' %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user