diff --git a/tree_view_advanced_filter/__manifest__.py b/tree_view_advanced_filter/__manifest__.py index 3957243d2..6ecbf76cc 100644 --- a/tree_view_advanced_filter/__manifest__.py +++ b/tree_view_advanced_filter/__manifest__.py @@ -67,9 +67,10 @@ "tree_view_advanced_filter/static/src/web_list_num/**/*", "tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/js/*", "tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/xml/*", - "tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/*", + "tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/scss/*" ] }, + "images": ["static/description/banner.jpg"], "installable": True, "auto_install": False, diff --git a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/js/list_view_sticky_header_and_column.js b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/js/list_view_sticky_header_and_column.js index 05f3d1f1f..0930bfa4b 100644 --- a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/js/list_view_sticky_header_and_column.js +++ b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/js/list_view_sticky_header_and_column.js @@ -2,12 +2,11 @@ /** This file will used to stick the selected header and column in the list view **/ import { patch } from "@web/core/utils/patch"; import { ListRenderer } from "@web/views/list/list_renderer"; -import { useService } from "@web/core/utils/hooks"; patch(ListRenderer.prototype, { /** super the setup function **/ setup() { super.setup(); - this.orm = useService('orm'); + }, /** * function defining the button having t-on-click _onClick @@ -52,9 +51,6 @@ patch(ListRenderer.prototype, { } } }); - // debugger - // this.props.updateForzenColumns(columnIndex); - this.saveManagerData(columnIndex); }, /** * super onClickSortColumn function and remove the icon and element having the class sticky-column @@ -65,20 +61,5 @@ patch(ListRenderer.prototype, { $(this.__owl__.bdom.parentEl.querySelectorAll('.clicked-header')).removeClass('clicked-header'); const $tableHeaders = $(this.__owl__.bdom.parentEl.querySelectorAll('.o_list_table th')); $tableHeaders.removeClass('sticky-column').css('left', ''); - }, - saveManagerData(num) { - return this.env.model.orm.call( - 'ir.ui.view', - 'save_manager_data', - [ - this.env.config.viewId, - { - columns: this.props.ooManagerColumns, - filter: this.props.ooManagerFilter, - serial_num: this.props.ooManagerSerialNum, - frozen_columns: num, // 加入保存 - } - ] - ); } }); diff --git a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/xml/list_view_sticky_header_and_column.xml b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/xml/list_view_sticky_header_and_column.xml index 31d120867..82d9ff4d7 100644 --- a/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/xml/list_view_sticky_header_and_column.xml +++ b/tree_view_advanced_filter/static/src/list_view_sticky_header_and_column/xml/list_view_sticky_header_and_column.xml @@ -1,52 +1,49 @@ - - + - - - - - - + + + + - - - - - - + + + - - - - - - + + + - - - - - \ No newline at end of file + + + diff --git a/tree_view_advanced_filter/static/src/web_list_num/list_renderer.js b/tree_view_advanced_filter/static/src/web_list_num/list_renderer.js index b5986ab20..88b335904 100644 --- a/tree_view_advanced_filter/static/src/web_list_num/list_renderer.js +++ b/tree_view_advanced_filter/static/src/web_list_num/list_renderer.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import { patch } from "@web/core/utils/patch"; -import { ListRenderer } from "@web/views/list/list_renderer"; +import {patch} from "@web/core/utils/patch"; +import {ListRenderer} from "@web/views/list/list_renderer"; patch(ListRenderer.prototype, { - setup() { - super.setup(); - this.numSwitch = this.constructor.name === 'ListRenderer'; + setup(){ + super.setup(); + this.numSwitch = this.constructor.name === 'ListRenderer'; }, // The following code manipulates the DOM directly to avoid having to wait for a @@ -43,7 +43,7 @@ patch(ListRenderer.prototype, { if (!th.style.width) { th.style.width = `${Math.floor(this.columnWidths[index])}px`; } - if (Array.from(th.classList).includes('list-number')) { + if (Array.from(th.classList).includes('list-number')){ th.style.width = `${String(this.props.list.offset || this.props.list.limit).length * 20}px`; } });