跳至内容
菜单
此问题已终结
1 回复
4126 查看

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
    2159
    1
    3月 17
    2650
    0
    9月 24
    769
    0
    6月 24
    1254
    1
    6月 23
    2757