You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
1.0 KiB

/** @odoo-module **/
import { rpc } from '@web/core/network/rpc';
import publicWidget from "@web/legacy/js/public/public_widget";
publicWidget.registry.TT = publicWidget.Widget.extend({
selector: '#ticket',
events: {
'change #group_select': '_onGroupSelectChange',
'click #search_ticket': '_onSubmit',
},
// GroupBy filtering the portal tickets
_onGroupSelectChange: function (ev) {
var self = this;
var searchValue = this.$el.find('#group_select').val();
rpc('/ticketgroupby', {
'search_value': searchValue,
}).then(function (result) {
$('.search_ticket').html(result);
});
},
// Searching the portal tickets
_onSubmit(ev) {
var search_value = this.$el.find('#search_box').val();
rpc('/ticketsearch', {
'search_value': search_value,
}).then(function(result) {
$('.search_ticket').html(result);
});
}
})