Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4143 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

    Ảnh đại diện
    Huỷ bỏ
    Bài viết liên quan Trả lời Lượt xem Hoạt động
    1
    thg 3 23
    2184
    1
    thg 3 17
    2673
    0
    thg 9 24
    794
    0
    thg 6 24
    1287
    1
    thg 6 23
    2800