跳至內容
選單
此問題已被標幟
1 回覆
4117 瀏覽次數

odoo 14 - dynamic snippet has only country and if e-coms  installed  product in  the drop down list.

I have added a new "User-defined filter" and tried many  different names eg.  "xyz"  and  model eg.  blog or contact  etc...  but  I can't get it to show the new filter in dynamic snippet  fillter drop  down list, 

Have  also  tried  Superuser also dev-mode all,  dev_mode  XML etc.. .

I give up, any help most appriciated.

頭像
捨棄
最佳答案

Hello D Stout,

Added a input of type "search" in xml file.
then you have to write a js code for above input

write a keyup event for above input which call a controller and pass the string.
from that controller return the value .Then append the value and name in list

example :
$("#search-input").keyup(function() {
$("#searchResult").empty();
var search = $(this).val();
if (search != "") {
ajax.jsonRpc("/product/filter", 'call', {
'search_string': search,
}).then(
function(product) {
var markup = "";
for (var i = 0; i < product.length; i++) {
markup = '

  • ' + product[i]['product_name'] + '
  • ';
    $("#c").append(markup);
    }
    })
    }

    });

    Thanks & Regards,

    Email: odoo@aktivsoftware.com

    Skype: kalpeshmaheshwari

    頭像
    捨棄
    相關帖文 回覆 瀏覽次數 活動
    1
    3月 23
    2152
    1
    3月 17
    2642
    0
    9月 24
    763
    0
    6月 24
    1247
    1
    6月 23
    2742