diff --git a/chatter_view_filter/README.rst b/chatter_view_filter/README.rst new file mode 100644 index 000000000..6e83b21b5 --- /dev/null +++ b/chatter_view_filter/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Chatter View Filter +===================== +* Chatter View Filter module for Odoo 17. + +Installation +============ + - www.odoo.com/documentation/17.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V17) Shikhil Raj +Contact : odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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/chatter_view_filter/__init__.py b/chatter_view_filter/__init__.py new file mode 100644 index 000000000..3e9d69afe --- /dev/null +++ b/chatter_view_filter/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/chatter_view_filter/__manifest__.py b/chatter_view_filter/__manifest__.py new file mode 100644 index 000000000..a8eb1bc5d --- /dev/null +++ b/chatter_view_filter/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Chatter View Filter", + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Enhance the chatter view with filter tab in chatter header + for improving readability""", + 'description': """This module enhances Odoo chatter views by introducing + filter icon.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['mail', 'web'], + 'assets': { + 'web.assets_backend': [ + 'chatter_view_filter/static/src/js/thread_service_patch.js', + 'chatter_view_filter/static/src/js/filter_search.js', + 'chatter_view_filter/static/src/xml/filter_search.xml', + 'chatter_view_filter/static/src/css/filter_search.css' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/chatter_view_filter/controllers/__init__.py b/chatter_view_filter/controllers/__init__.py new file mode 100644 index 000000000..eb06f14cb --- /dev/null +++ b/chatter_view_filter/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import thread \ No newline at end of file diff --git a/chatter_view_filter/controllers/thread.py b/chatter_view_filter/controllers/thread.py new file mode 100644 index 000000000..e14416582 --- /dev/null +++ b/chatter_view_filter/controllers/thread.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import http +from odoo.http import request + + +class ThreadController(http.Controller): + @http.route("/mail/thread/messages", methods=["POST"], type="json", + auth="user") + def mail_thread_messages(self, thread_model, thread_id, search_term=None, + before=None, after=None, around=None, limit=30, + search_date=None, follower_search_id = None): + """customize the function for adding new arguments""" + domain = [ + ("res_id", "=", int(thread_id)), + ("model", "=", thread_model), + ("message_type", "!=", "user_notification"), + ] + res = request.env["mail.message"]._message_fetch( + domain, search_term=search_term, before=before, after=after, + around=around, limit=limit, search_date=search_date, + follower_search_id=follower_search_id) + if not request.env.user._is_public(): + res["messages"].set_message_done() + return {**res, "messages": res["messages"].message_format()} diff --git a/chatter_view_filter/doc/RELEASE_NOTES.md b/chatter_view_filter/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..c637751ec --- /dev/null +++ b/chatter_view_filter/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.01.2025 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Chatter View Filter diff --git a/chatter_view_filter/models/__init__.py b/chatter_view_filter/models/__init__.py new file mode 100644 index 000000000..e77ce0eb2 --- /dev/null +++ b/chatter_view_filter/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import mail_followers +from . import mail_message diff --git a/chatter_view_filter/models/mail_followers.py b/chatter_view_filter/models/mail_followers.py new file mode 100644 index 000000000..ac6096aad --- /dev/null +++ b/chatter_view_filter/models/mail_followers.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, models + + +class Followers(models.Model): + """Inherited mail follower model for adding a new function""" + _inherit = "mail.followers" + + @api.model + def get_partner(self, follower_id): + """function for getting partner details""" + partner_id = self.sudo().browse(follower_id).partner_id + return partner_id.id, partner_id.name diff --git a/chatter_view_filter/models/mail_message.py b/chatter_view_filter/models/mail_message.py new file mode 100644 index 000000000..59cf092fe --- /dev/null +++ b/chatter_view_filter/models/mail_message.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models +from odoo.osv import expression +from datetime import datetime, timedelta + + +class MailMessage(models.Model): + """Inherited message model for super the _message_fetch """ + _inherit = 'mail.message' + + def _message_fetch(self, domain, search_term=None, before=None, after=None, + around=None, limit=30, search_date=None, + follower_search_id = None): + """function for fetching messages""" + res = {} + if follower_search_id : + domain = expression.AND([domain, expression.OR([ + [("author_id.id", "=", follower_search_id)], + ])]) + + if search_date: + from_date_min = datetime.strptime(search_date, "%Y-%m-%d") + from_date_max = from_date_min + timedelta(days=1) + domain = expression.AND([domain, expression.AND([ + [("date", ">=", from_date_min)], + [('date', "<", from_date_max)] + ])]) + if search_term: + if not follower_search_id and not search_date: + search_term = search_term.replace(" ", "%") + domain = expression.AND([domain, expression.OR([ + # sudo: access to attachment is allowed if you have access to the parent model + [("attachment_ids", "in", + self.env["ir.attachment"].sudo()._search( + [("name", "ilike", search_term)]))], + [("body", "ilike", search_term)], + [("subject", "ilike", search_term)], + [("subtype_id.description", "ilike", search_term)], + ])]) + domain = expression.AND([domain, [("message_type", "not in", + ["user_notification", + "notification"])]]) + + res["count"] = self.search_count(domain) + if around: + messages_before = self.search( + domain=[*domain, ('id', '<=', around)], limit=limit // 2, + order="id DESC") + messages_after = self.search(domain=[*domain, ('id', '>', around)], + limit=limit // 2, order='id ASC') + return {**res, + "messages": (messages_after + messages_before). + sorted('id', reverse=True)} + if before: + domain = expression.AND([domain, [('id', '<', before)]]) + if after: + domain = expression.AND([domain, [('id', '>', after)]]) + + res["messages"] = self.search(domain, limit=limit, + order='id ASC' if after else 'id DESC') + if after: + res["messages"] = res["messages"].sorted('id', reverse=True) + return res diff --git a/chatter_view_filter/static/description/assets/icons/capture (1).png b/chatter_view_filter/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/capture (1).png differ diff --git a/chatter_view_filter/static/description/assets/icons/check.png b/chatter_view_filter/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/check.png differ diff --git a/chatter_view_filter/static/description/assets/icons/chevron.png b/chatter_view_filter/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/chevron.png differ diff --git a/chatter_view_filter/static/description/assets/icons/cogs.png b/chatter_view_filter/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/cogs.png differ diff --git a/chatter_view_filter/static/description/assets/icons/consultation.png b/chatter_view_filter/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/consultation.png differ diff --git a/chatter_view_filter/static/description/assets/icons/ecom-black.png b/chatter_view_filter/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/ecom-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/education-black.png b/chatter_view_filter/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/education-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/hotel-black.png b/chatter_view_filter/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/hotel-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/img.png b/chatter_view_filter/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/img.png differ diff --git a/chatter_view_filter/static/description/assets/icons/license.png b/chatter_view_filter/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/license.png differ diff --git a/chatter_view_filter/static/description/assets/icons/lifebuoy.png b/chatter_view_filter/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/lifebuoy.png differ diff --git a/chatter_view_filter/static/description/assets/icons/manufacturing-black.png b/chatter_view_filter/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/manufacturing-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/photo-capture.png b/chatter_view_filter/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/photo-capture.png differ diff --git a/chatter_view_filter/static/description/assets/icons/pos-black.png b/chatter_view_filter/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/pos-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/puzzle.png b/chatter_view_filter/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/puzzle.png differ diff --git a/chatter_view_filter/static/description/assets/icons/restaurant-black.png b/chatter_view_filter/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/restaurant-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/service-black.png b/chatter_view_filter/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/service-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/trading-black.png b/chatter_view_filter/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/trading-black.png differ diff --git a/chatter_view_filter/static/description/assets/icons/training.png b/chatter_view_filter/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/training.png differ diff --git a/chatter_view_filter/static/description/assets/icons/update.png b/chatter_view_filter/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/update.png differ diff --git a/chatter_view_filter/static/description/assets/icons/user.png b/chatter_view_filter/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/user.png differ diff --git a/chatter_view_filter/static/description/assets/icons/wrench.png b/chatter_view_filter/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/chatter_view_filter/static/description/assets/icons/wrench.png differ diff --git a/chatter_view_filter/static/description/assets/misc/Cybrosys R.png b/chatter_view_filter/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/chatter_view_filter/static/description/assets/misc/Cybrosys R.png differ diff --git a/chatter_view_filter/static/description/assets/misc/email.svg b/chatter_view_filter/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/phone.svg b/chatter_view_filter/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/chatter_view_filter/static/description/assets/misc/star (1) 2.svg b/chatter_view_filter/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/support (1) 1.svg b/chatter_view_filter/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/support-email.svg b/chatter_view_filter/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/tick-mark.svg b/chatter_view_filter/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/whatsapp 1.svg b/chatter_view_filter/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/misc/whatsapp.svg b/chatter_view_filter/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/chatter_view_filter/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chatter_view_filter/static/description/assets/modules/1.jpg b/chatter_view_filter/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..0b59ec131 Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/1.jpg differ diff --git a/chatter_view_filter/static/description/assets/modules/2.jpg b/chatter_view_filter/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..1e087eed6 Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/2.jpg differ diff --git a/chatter_view_filter/static/description/assets/modules/3.jpg b/chatter_view_filter/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..efebcb605 Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/3.jpg differ diff --git a/chatter_view_filter/static/description/assets/modules/4.png b/chatter_view_filter/static/description/assets/modules/4.png new file mode 100644 index 000000000..1f3f2e27f Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/4.png differ diff --git a/chatter_view_filter/static/description/assets/modules/5.png b/chatter_view_filter/static/description/assets/modules/5.png new file mode 100644 index 000000000..0ac2ef20d Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/5.png differ diff --git a/chatter_view_filter/static/description/assets/modules/6.png b/chatter_view_filter/static/description/assets/modules/6.png new file mode 100644 index 000000000..56e6eaa24 Binary files /dev/null and b/chatter_view_filter/static/description/assets/modules/6.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/1.png b/chatter_view_filter/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..9747c1233 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/1.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/2.png b/chatter_view_filter/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..927f35baf Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/2.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/3.png b/chatter_view_filter/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..48cd6bc27 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/3.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/4.png b/chatter_view_filter/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..67b442492 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/4.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/5.png b/chatter_view_filter/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..1c0f65738 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/5.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/6.png b/chatter_view_filter/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..74ae36933 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/6.png differ diff --git a/chatter_view_filter/static/description/assets/screenshots/hero.gif b/chatter_view_filter/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..a4969cd74 Binary files /dev/null and b/chatter_view_filter/static/description/assets/screenshots/hero.gif differ diff --git a/chatter_view_filter/static/description/banner.jpg b/chatter_view_filter/static/description/banner.jpg new file mode 100644 index 000000000..89befbfcd Binary files /dev/null and b/chatter_view_filter/static/description/banner.jpg differ diff --git a/chatter_view_filter/static/description/icon.png b/chatter_view_filter/static/description/icon.png new file mode 100644 index 000000000..ef0eb1a09 Binary files /dev/null and b/chatter_view_filter/static/description/icon.png differ diff --git a/chatter_view_filter/static/description/index.html b/chatter_view_filter/static/description/index.html new file mode 100644 index 000000000..d7399164d --- /dev/null +++ b/chatter_view_filter/static/description/index.html @@ -0,0 +1,728 @@ + + + + + + + Chatter View Filter + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ Chatter View Filter

+

+ Enhances Odoo chatter views by introducing filter icon. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Message filtering by follower.

+
+
+
+
+
+
+ +
+
+

+ Message filtering by Date.

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

+ Filter icon on search bar in chatter

+
+
+
+
+
+
+ +
+
+

+ Followers are listed under 'Followers' when clicking the filter button.

+
+
+
+
+
+
+ +
+
+

+ Listed all messages

+

+ When clicking on any listed follower, all messages created by them will be displayed.

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

+ Date field on the Chatter search

+
+
+
+
+
+
+ +
+
+

+ List all messages that were created on a selected date. +

+
+
+
+
+
+
+
    +
  • + Users can filter messages based on followers. +
  • +
  • + + Users can filter messages based on the creation date. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:24 Sep 2024 +
+

+ Initial Commit for Chatter View Filter

+
+
+
+
+
+
+
+

+ 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/chatter_view_filter/static/src/css/filter_search.css b/chatter_view_filter/static/src/css/filter_search.css new file mode 100644 index 000000000..a1e2c8366 --- /dev/null +++ b/chatter_view_filter/static/src/css/filter_search.css @@ -0,0 +1,12 @@ +.follower_menu{ + display:block; + margin:0px; + text-align: center; + font-weight: 700; + } +.date_filter_values{ + display:block; + margin:0px; + text-align: center; + font-weight: 700; + } \ No newline at end of file diff --git a/chatter_view_filter/static/src/js/filter_search.js b/chatter_view_filter/static/src/js/filter_search.js new file mode 100644 index 000000000..b0cd7e92c --- /dev/null +++ b/chatter_view_filter/static/src/js/filter_search.js @@ -0,0 +1,119 @@ +/** @odoo-module **/ +import { Component, useState, onWillUnmount } from '@odoo/owl'; +import { useService } from "@web/core/utils/hooks"; +import { patch } from "@web/core/utils/patch"; +import { useSequential } from "@mail/utils/common/hooks"; +import { DateTimeInput } from "@web/core/datetime/datetime_input"; +import { useVisible } from "@mail/utils/common/hooks"; +import { SearchMessagesPanel } from "@mail/core/common/search_messages_panel"; +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { searchHighlight } from "@mail/core/common/message_search_hook"; +export function useMessageSearch(thread) { + const threadService = useService("mail.thread"); + const sequential = useSequential(); + const state = useState({ + thread, + async search(before = false) { + if (this.searchTerm) { + this.searching = true; + const data = await sequential(() => + + threadService.search(this.searchTerm, this.thread, before, + this.searchDate, this.followerSearch_id) + ); + if (!data) { + return; + } + const { count, loadMore, messages } = data; + this.searched = true; + this.searching = false; + this.count = count; + this.loadMore = loadMore; + if (before) { + this.messages.push(...messages); + } else { + this.messages = messages; + } + } else { + this.clear(); + } + }, + count: 0, + clear() { + this.messages = []; + this.searched = false; + this.searching = false; + this.searchTerm = undefined; + }, + loadMore: false, + /** @type {import('@mail/core/common/message_model').Message[]} */ + messages: [], + /** @type {string|undefined} */ + searchTerm: undefined, + searched: false, + searching: false, + /** @param {string} target */ + highlight: (target) => searchHighlight(state.searchTerm, target), + }); + onWillUnmount(() => { + state.clear(); + }); + return state; +} +patch(SearchMessagesPanel.prototype, { + setup() { + super.setup(); + this.store = useState(useService("mail.store")); + this.orm = useService("orm"); + this.messageSearch = useMessageSearch(this.props.thread); + this.threadService = useState(useService("mail.thread")); + this.loadMoreState = useVisible("load-more", () => { + if (this.loadMoreState.isVisible) { + this.threadService.loadMoreFollowers(this.props.thread); + } + }); + onWillUnmount(() => { + this.props.filterSearch = false + }); + }, + + async onAddUserFilterClick(follower, selfFollower){ + const follower_id = follower + const [partner_id, partner_name] = await this.orm.call("mail.followers", "get_partner", [follower_id], {}) + this.props.followerSearch = partner_id + this.messageSearch.followerSearch_id = this.props.followerSearch + this.state.searchTerm = partner_name + this.search() + }, + onChanged(date){ + if (date){ + if (date.c.year && date.c.month && date.c.day) { + let month = date.c.month < 10 ? '0' + date.c.month : date.c.month; + let day = date.c.day < 10 ? '0' + date.c.day : date.c.day; + + date = `${date.c.year}-${month}-${day}`; + this.props.date = date + return date + } + } + }, + + async DateMessageSearch(){ + this.props.filterSearch = true + this.messageSearch.searchDate = this.props.date + this.state.searchTerm = this.props.date + this.search() + + }, +}); + +// Extend the components on the patched element +Object.assign(SearchMessagesPanel, { + components: { + ...SearchMessagesPanel.components, // Preserve existing components + Dropdown, + DropdownItem, + DateTimeInput, + }, +}); diff --git a/chatter_view_filter/static/src/js/thread_service_patch.js b/chatter_view_filter/static/src/js/thread_service_patch.js new file mode 100644 index 000000000..a870c6d9c --- /dev/null +++ b/chatter_view_filter/static/src/js/thread_service_patch.js @@ -0,0 +1,40 @@ +/** @odoo-module */ +import { _t } from "@web/core/l10n/translation"; +import { ThreadService } from "@mail/core/common/thread_service"; +import { prettifyMessageContent } from "@mail/utils/common/format"; +import { patch } from "@web/core/utils/patch"; +const FETCH_LIMIT = 30; + +patch(ThreadService.prototype, { + /** + * @override + * @param {import("models").Thread} thread + */ + getFetchParams(thread) { + if (thread.model === "discuss.channel") { + return { channel_id: thread.id }; + } + if (thread.type === "chatter") { + return { + thread_id: thread.id, + thread_model: thread.model, + }; + } + return {}; + }, + + async search(searchTerm, thread, before = false, searchDate=false,followerSearch_id=false) { + const { messages, count } = await this.rpc(this.getFetchRoute(thread), { + ...this.getFetchParams(thread), + search_term: await prettifyMessageContent(searchTerm), // formatted like message_post + before, + search_date : searchDate, + follower_search_id : followerSearch_id + }); + return { + count, + loadMore: messages.length === FETCH_LIMIT, + messages: this.store.Message.insert(messages, { html: true }), + }; + } +}) \ No newline at end of file diff --git a/chatter_view_filter/static/src/xml/filter_search.xml b/chatter_view_filter/static/src/xml/filter_search.xml new file mode 100644 index 000000000..82c6aca48 --- /dev/null +++ b/chatter_view_filter/static/src/xml/filter_search.xml @@ -0,0 +1,51 @@ + + + + + + +