Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4132 Visualizzazioni

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
Abbandona
Risposta migliore

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
    Abbandona
    Post correlati Risposte Visualizzazioni Attività
    1
    mar 23
    2164
    1
    mar 17
    2652
    0
    set 24
    770
    0
    giu 24
    1256
    1
    giu 23
    2778