Browse Source

Nov 17 : [FIX]Bug Fixed 'one2many_search_widget'

pull/295/head
AjmalCybro 2 years ago
parent
commit
6a55bc5e12
  1. 2
      one2many_search_widget/doc/RELEASE_NOTES.md
  2. 3
      one2many_search_widget/static/src/js/one2manySearch.js
  3. 5
      one2many_search_widget/static/src/xml/one2manysearch.xml

2
one2many_search_widget/doc/RELEASE_NOTES.md

@ -4,5 +4,3 @@
#### Version 16.0.1.0.0
#### ADD
- Initial commit for One2many Search Widget

3
one2many_search_widget/static/src/js/one2manySearch.js

@ -13,7 +13,8 @@ export class One2ManySearch extends X2ManyField {
*/
onInputKeyUp() {
var value = $(event.currentTarget).val().toLowerCase();
$(".o_list_table tr:not(:lt(1))").filter(function() {
var table_id = $(event.currentTarget)[0].id
$('.o_field_widget.o_field_one2many_search[name="'+ table_id +'"]').find(".o_list_table tr:not(:lt(1))").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
}

5
one2many_search_widget/static/src/xml/one2manysearch.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<!-- Inherits X2Many field to Add the Searche Bar-->
<!-- Inherits X2Many field to Add the Searche Bar-->
<t t-name="One2ManySearchTemplate" t-inherit="web.X2ManyField"
t-inherit-mode="primary" owl="1">
<t t-if="displayAddButton" position="replace">
@ -8,6 +8,7 @@
<div>
<input type="text" class="oe_search_value searchInput pl-3"
placeholder="Search..."
t-att-id="this.props.id"
t-ref="search_keyword"
style="margin-bottom:10px;height:30px;"
t-on-keyup="onInputKeyUp"/>
@ -16,7 +17,7 @@
<t t-if="displayAddButton">
<div class="o_cp_buttons me-0 ms-auto" role="toolbar"
aria-label="Control panel buttons"
t-ref="buttons">
t-ref="buttons">viewMode
<div>
<button type="button"
class="btn btn-secondary o-kanban-button-new"

Loading…
Cancel
Save