DB-Schema-Anpassungen für »Spaltentyp Text anstelle von varchar() in diversen Tabellen«
[kivitendo-erp.git] / js / autocomplete_part.js
index 62c1bf4..d9bf8db 100644 (file)
@@ -16,8 +16,7 @@ namespace('kivi', function(k){
     var o = $.extend({
       limit: 20,
       delay: 50,
-      fat_set_item: 0, // use this option to get a fat item json with all
-                       // relevant data instead of the guaranteed id + name
+      fat_set_item: $real.hasClass('partpicker_fat_set_item'),
     }, options);
     var STATES = {
       UNIQUE: 1,
@@ -53,7 +52,7 @@ namespace('kivi', function(k){
 
     function ajax_data(term) {
       var data = {
-        'filter.all:substr::ilike': term,
+        'filter.all:substr:multi::ilike': term,
         'filter.obsolete': 0,
         'filter.unit_obj.convertible_to': $convertible_unit && $convertible_unit.val() ? $convertible_unit.val() : '',
         no_paginate:  $('#no_paginate').prop('checked') ? 1 : 0,
@@ -84,7 +83,7 @@ namespace('kivi', function(k){
       last_dummy = $dummy.val();
       $real.trigger('change');
 
-      if (o.fat_set_item) {
+      if (o.fat_set_item && item.id) {
         $.ajax({
           url: 'controller.pl?action=Part/show.json',
           data: { id: item.id },