diff --git a/tree_view_advanced_search/README.rst b/tree_view_advanced_search/README.rst new file mode 100644 index 000000000..c84e0cacf --- /dev/null +++ b/tree_view_advanced_search/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +TREE VIEW ADVANCED SEARCH +========================= +This module helps you easily search multiple data in your list view based on the fields. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, v3.0 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developers: (V17) Kailas Krishna + Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/tree_view_advanced_search/__init__.py b/tree_view_advanced_search/__init__.py new file mode 100644 index 000000000..65578fb32 --- /dev/null +++ b/tree_view_advanced_search/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Kailas Krishna () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ diff --git a/tree_view_advanced_search/__manifest__.py b/tree_view_advanced_search/__manifest__.py new file mode 100644 index 000000000..0edaaa98d --- /dev/null +++ b/tree_view_advanced_search/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Kailas Krishna () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Tree view Advanced Search', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Advanced search feature in all tree views""", + 'description': """It enhances user experience by enabling both single and + multiple search capabilities across all tree view displays. It facilitates + multiple search filters on single columns, allowing users to easily search + through various data types such as text, date/datetime, many2one, integer, + and float columns.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['web', 'purchase', 'account'], + 'assets': { + 'web.assets_backend': [ + 'tree_view_advanced_search/static/src/js/components/date_range.js', + 'tree_view_advanced_search/static/src/js/components/date_range.xml', + 'tree_view_advanced_search/static/src/css/search_bar_view.css', + 'tree_view_advanced_search/static/src/js/list_renderer_search_bar.js', + 'tree_view_advanced_search/static/src/xml/list_renderer_search_bar.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/tree_view_advanced_search/doc/RELEASE_NOTES.md b/tree_view_advanced_search/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..dbaf24934 --- /dev/null +++ b/tree_view_advanced_search/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 23.10.2024 +#### Version 17.0.1.0.0 +##### ADD + +- Initial Commit for Tree View Advanced Search diff --git a/tree_view_advanced_search/static/description/assets/icons/check.png b/tree_view_advanced_search/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/check.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/chevron.png b/tree_view_advanced_search/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/chevron.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/cogs.png b/tree_view_advanced_search/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/cogs.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/consultation.png b/tree_view_advanced_search/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/consultation.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/ecom-black.png b/tree_view_advanced_search/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/ecom-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/education-black.png b/tree_view_advanced_search/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/education-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/hotel-black.png b/tree_view_advanced_search/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/hotel-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/license.png b/tree_view_advanced_search/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/license.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/lifebuoy.png b/tree_view_advanced_search/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/lifebuoy.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/logo.png b/tree_view_advanced_search/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/logo.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/manufacturing-black.png b/tree_view_advanced_search/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/manufacturing-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/pos-black.png b/tree_view_advanced_search/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/pos-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/puzzle.png b/tree_view_advanced_search/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/puzzle.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/restaurant-black.png b/tree_view_advanced_search/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/restaurant-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/service-black.png b/tree_view_advanced_search/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/service-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/trading-black.png b/tree_view_advanced_search/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/trading-black.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/training.png b/tree_view_advanced_search/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/training.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/update.png b/tree_view_advanced_search/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/update.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/user.png b/tree_view_advanced_search/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/user.png differ diff --git a/tree_view_advanced_search/static/description/assets/icons/wrench.png b/tree_view_advanced_search/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/icons/wrench.png differ diff --git a/tree_view_advanced_search/static/description/assets/misc/Cybrosys R.png b/tree_view_advanced_search/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/misc/Cybrosys R.png differ diff --git a/tree_view_advanced_search/static/description/assets/misc/email.svg b/tree_view_advanced_search/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/phone.svg b/tree_view_advanced_search/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/star (1) 2.svg b/tree_view_advanced_search/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/support (1) 1.svg b/tree_view_advanced_search/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/support-email.svg b/tree_view_advanced_search/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/tick-mark.svg b/tree_view_advanced_search/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/whatsapp 1.svg b/tree_view_advanced_search/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/misc/whatsapp.svg b/tree_view_advanced_search/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/tree_view_advanced_search/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tree_view_advanced_search/static/description/assets/modules/1.jpg b/tree_view_advanced_search/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..a094e97b6 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/1.jpg differ diff --git a/tree_view_advanced_search/static/description/assets/modules/2.jpg b/tree_view_advanced_search/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..ad21f1ab8 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/2.jpg differ diff --git a/tree_view_advanced_search/static/description/assets/modules/3.jpg b/tree_view_advanced_search/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..31f2bc9f5 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/3.jpg differ diff --git a/tree_view_advanced_search/static/description/assets/modules/4.jpg b/tree_view_advanced_search/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..641aa46e0 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/4.jpg differ diff --git a/tree_view_advanced_search/static/description/assets/modules/5.png b/tree_view_advanced_search/static/description/assets/modules/5.png new file mode 100644 index 000000000..511d4d392 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/5.png differ diff --git a/tree_view_advanced_search/static/description/assets/modules/6.png b/tree_view_advanced_search/static/description/assets/modules/6.png new file mode 100644 index 000000000..ddc2956ca Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/modules/6.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/1.png b/tree_view_advanced_search/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..1dc89522c Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/1.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/2.png b/tree_view_advanced_search/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..dafada70e Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/2.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/3.png b/tree_view_advanced_search/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..9ad27e6f6 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/3.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/4.png b/tree_view_advanced_search/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6936f2142 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/4.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/5.png b/tree_view_advanced_search/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..0e4451e19 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/5.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/6.png b/tree_view_advanced_search/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..bd7062578 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/6.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/7.png b/tree_view_advanced_search/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..d69ffcc30 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/7.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/8.png b/tree_view_advanced_search/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..c139fd9e6 Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/8.png differ diff --git a/tree_view_advanced_search/static/description/assets/screenshots/hero.gif b/tree_view_advanced_search/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..b80e1bcac Binary files /dev/null and b/tree_view_advanced_search/static/description/assets/screenshots/hero.gif differ diff --git a/tree_view_advanced_search/static/description/banner.jpg b/tree_view_advanced_search/static/description/banner.jpg new file mode 100644 index 000000000..4867fc933 Binary files /dev/null and b/tree_view_advanced_search/static/description/banner.jpg differ diff --git a/tree_view_advanced_search/static/description/icon.png b/tree_view_advanced_search/static/description/icon.png new file mode 100644 index 000000000..04005da3e Binary files /dev/null and b/tree_view_advanced_search/static/description/icon.png differ diff --git a/tree_view_advanced_search/static/description/index.html b/tree_view_advanced_search/static/description/index.html new file mode 100644 index 000000000..eed467d07 --- /dev/null +++ b/tree_view_advanced_search/static/description/index.html @@ -0,0 +1,709 @@ + + + + + + + Odoo App 3 Index + + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ Tree view Advanced Search

+

+ Comprehensive Search Feature in All Applications of Odoo. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

All Tree View Filter

+

Enable single or multiple search capabilities across all tree view displays. +

+
+
+
+
+
+
+ +
+
+

Allows Multiple Search

+

Allows multiple search filters on single column. +

+
+
+
+
+
+
+ +
+
+

+ Users can search text, date, and numeric columns easily. +

+

User can easily search on text, date/datetime, many2one, integer/float columns. +

+
+
+
+
+
+
+ +
+
+

+ Date fields can be filtered by ranges +

+

Fields of type date and datetime can be filtered by date ranges. +

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

+ Single/multi search on Tree View

+

+ After installing this module, users will notice an additional row in every tree view, + incorporating column filters. Users can effortlessly search through text, date/datetime, + many2one, integer, and float columns. +

+
+
+
+
+
+
+ +
+
+

+ Apply multiple search filters on single columns

+

+ Allows multiple search filters on single column. +

+
+
+
+
+
+
+ +
+
+ +
+
+

+ Filtering for date fields

+

+ Allows filtration for date field in different ways. +

+
+
+
+
+
+
+ +
+
+

+ Apply multiple search filters on single columns and also filtered based on status

+
+
+
+
+
+
+ +
+
+

+ Searching data within selection fields is exceptionally simple

+
+
+
+
+
+
+ +
+
+

+ Filter will not be visible on non-storable fields and widgets.

+
+
+
+
+
+
+ +
+
+

+ Integer and Float Columns

+

+ Integer and Float columns will single/multi search for the exact value inputted by the user. +

+
+
+
+
+
+
+
    +
  • + The quick search section is available over all list/tree views. +
  • +
  • + Multiple search queries can be performed over every fields. +
  • +
  • + Fields of type date and datetime can be filtered by date ranges. +
  • +
  • + Enable single or multiple search capabilities across all tree view displays. +
  • +
  • + User can easily search on text, date/datetime, many2one, integer/float columns. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on : 23rd October 2024 +
+

+ Tree view Advanced Search.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/tree_view_advanced_search/static/src/css/search_bar_view.css b/tree_view_advanced_search/static/src/css/search_bar_view.css new file mode 100644 index 000000000..611edc278 --- /dev/null +++ b/tree_view_advanced_search/static/src/css/search_bar_view.css @@ -0,0 +1,65 @@ +.search-input { + border: 1px solid #ccc; + padding: 5px; + display: inline-block; + border-radius: 5px; + background-color: #E7E8ED; + max-height: 71px; + overflow: auto; +} +.search-input::-webkit-scrollbar { + display: none; +} +.input_data { + border: none; + outline: none; + padding: 5px; + font-size: 16px; + background-color: #E7E8ED; +} +.dp-class { + height: 48px; + margin-bottom: 5px; + border-radius: 9px; +} +.fa-search { + margin-top: 18px; + margin-left: -18px; + transform: translateY(-50%); + color: #030202; +} +.fa-close { + margin-left: 5px; + color: #f50505; +} +.tag { + background-color: #f0f0f0; + border: 1px solid #ccc; + border-radius: 3px; + padding: 2px 5px; + margin-top: 2px; + margin-right: 5px; + display: inline-flex; + align-items: center; +} +.tag-remove { + cursor: pointer; + margin-left: 5px; + color: #777; + font-weight: bold; +} +.date-input { + border: 1px solid #ccc; + font-size: 15px; + height: 48px; + background-color: #E7E8ED; + padding-left: 12px; + padding-top: 11px; + margin-left: 2px; + border-radius: 5px; + margin-top: -16px; +} +.arrow{ + padding-bottom: 15px; + padding-left: 2px; +} diff --git a/tree_view_advanced_search/static/src/js/components/date_range.js b/tree_view_advanced_search/static/src/js/components/date_range.js new file mode 100644 index 000000000..4c0de17fb --- /dev/null +++ b/tree_view_advanced_search/static/src/js/components/date_range.js @@ -0,0 +1,42 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; +import { _t } from "@web/core/l10n/translation"; +import { DateTimeInput } from "@web/core/datetime/datetime_input"; +import { serializeDate, deserializeDate } from "@web/core/l10n/dates"; + +export class DateRange extends Component { + static template = "DateRange"; + static components = { DateTimeInput }; + static props = { + onFromToChanged: Function, + }; + fromPlaceholder = _t("Date From"); + toPlaceholder = _t("Date To"); + + setup(){ + this.state = owl.useState({ + from: false, + to: false, + }) + } + onDateFromChanged(dateFrom) { + this.props.onFromToChanged({ + from: dateFrom && serializeDate(dateFrom.startOf("day")), + to: this.state.to, + }); + this.state.from = dateFrom && serializeDate(dateFrom.startOf("day")) + } + onDateToChanged(dateTo) { + this.props.onFromToChanged({ + from: this.state.from, + to: dateTo && serializeDate(dateTo.endOf("day")), + }); + this.state.to = dateTo && serializeDate(dateTo.endOf("day")) + } + get dateFrom() { + return this.state.from && deserializeDate(this.state.from); + } + get dateTo() { + return this.state.to && deserializeDate(this.state.to); + } +} diff --git a/tree_view_advanced_search/static/src/js/components/date_range.xml b/tree_view_advanced_search/static/src/js/components/date_range.xml new file mode 100644 index 000000000..31428ebc9 --- /dev/null +++ b/tree_view_advanced_search/static/src/js/components/date_range.xml @@ -0,0 +1,26 @@ + + + +
+
+ +
+
+ +
+
+ +
+
+
+
diff --git a/tree_view_advanced_search/static/src/js/list_renderer_search_bar.js b/tree_view_advanced_search/static/src/js/list_renderer_search_bar.js new file mode 100644 index 000000000..d7cd1c93c --- /dev/null +++ b/tree_view_advanced_search/static/src/js/list_renderer_search_bar.js @@ -0,0 +1,140 @@ +/** @odoo-module */ +import { ListRenderer } from "@web/views/list/list_renderer"; +import { patch } from "@web/core/utils/patch"; +import { DateRange } from "./components/date_range"; + +patch(ListRenderer.prototype, { + setup(){ + super.setup(); + this.domain = [], + this.selectedItem = null + }, + // Function for search while clicking "ENTER BUTTON" + _onKeyPress(ev, name, obj) { + if (ev.key === "Enter" && ev.currentTarget.value.trim() !== '') { + obj.addTag(ev.currentTarget.value.trim(), name); + ev.currentTarget.value = ''; + const Domain = obj._getInputValueAndDomain(ev, name); + obj._getResultData(Domain); + } + }, + // Function to add search data in a pill structure + addTag(tagText, name) { + const tag = document.createElement('span'); + tag.className = 'tag'; + tag.textContent = tagText; + const removeButton = document.createElement('i'); + removeButton.className = 'fa fa-close'; + removeButton.addEventListener('click', () => this.removeTag(tag, name)); + tag.appendChild(removeButton); + document.getElementById(name+'Container').appendChild(tag); + }, + // Search function to filter, based on the input + _onClick_search: function(ev, name) { + this.addTag(ev.target.previousElementSibling.value, name); + ev.target.previousElementSibling.value = ''; + const Domain = this._getInputValueAndDomain(ev, name); + this._getResultData(Domain); + }, + // To set the domain for filter based on the user input + _getInputValueAndDomain(ev, name) { + const tags = ev.currentTarget.closest('.search-input').querySelectorAll('.tag'); + const inputValues = []; + tags.forEach(tag => { + inputValues.push(tag.textContent); + }); + var Domain =[] + if (inputValues.length>1) { + for (let input=0; input JSON.stringify(item) !== JSON.stringify(domain)); + this.env.searchModel.clearQuery(); + this.env.searchModel.splitAndAddDomain(this.domain); + } + else{ + this.selectedItem = value; + this._getResultData(Domain); + } + }, + // Function for filter in Date field + changeDate(name, date){ + if (date.from && date.to) { + var Domain = ['&', [name, '>=', date.from], [name, '<=', date.to]] + } + if (date.from && date.to == false) { + var Domain = [[name, '>=', date.from]] + } + if (date.from == false && date.to) { + var Domain = [[name, '<=', date.to]] + } + this._getResultData(Domain); + }, +}) +ListRenderer.components = {...ListRenderer.components, DateRange} diff --git a/tree_view_advanced_search/static/src/xml/list_renderer_search_bar.xml b/tree_view_advanced_search/static/src/xml/list_renderer_search_bar.xml new file mode 100644 index 000000000..1368a1658 --- /dev/null +++ b/tree_view_advanced_search/static/src/xml/list_renderer_search_bar.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + +
+
+ + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + + +