Skip to Content
Menu
This question has been flagged
1 Reply
3224 Views

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.

Avatar
Discard
Best Answer

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

    Avatar
    Discard
    Related Posts Replies Views Activity
    1
    Mar 23
    1218
    1
    Mar 17
    1957
    0
    Sep 24
    193
    0
    Jun 24
    439
    1
    Jun 23
    1894