diff --git a/custom_list_view/README.rst b/custom_list_view/README.rst new file mode 100644 index 000000000..f3b75d38b --- /dev/null +++ b/custom_list_view/README.rst @@ -0,0 +1,52 @@ +.. 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 + +Custom List View +================== +This module enhances list views by displaying row numbers.Additionally, it +facilitates the printing of list views in PDF, CSV, and Excel formats, +allows for the copying of list values to the clipboard, and introduces +a pagination feature. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU LESSER GENERAL PUBLIC LICENSE, v3.0 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers :(V15) Aiswarya J P + (V16) Rosmy John, Muhsina V + (v17) Akhil Ashok + 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/custom_list_view/__init__.py b/custom_list_view/__init__.py new file mode 100644 index 000000000..156acf2fb --- /dev/null +++ b/custom_list_view/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 diff --git a/custom_list_view/__manifest__.py b/custom_list_view/__manifest__.py new file mode 100644 index 000000000..fd752e5b9 --- /dev/null +++ b/custom_list_view/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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': 'Custom List View', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Helps to Show Row Number, Fixed Header, Duplicate Record, ' + 'Highlight Selected Record, Print and Copy Listview items', + 'description': "This module Helps to Show Row Number, Fixed Header, " + "Duplicate Record and Highlight Selected Record in List " + "View. Using this module the list view items can be printed" + " in pdf, excel and csv format, Also there is copy to " + "clipboard and pagination features.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['web', 'account'], + 'data': [ + 'report/custom_list_view_templates.xml', + 'report/custom_list_view_reports.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'custom_list_view/static/src/js/list_controller.js', + 'custom_list_view/static/src/js/list_renderer.js', + 'custom_list_view/static/src/xml/list_controller.xml', + 'custom_list_view/static/src/xml/list_renderer.xml', + ] + }, + 'images': ['static/description/banner.png'], + 'licence': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/custom_list_view/controllers/__init__.py b/custom_list_view/controllers/__init__.py new file mode 100644 index 000000000..3da0c4fa9 --- /dev/null +++ b/custom_list_view/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 custom_list_view diff --git a/custom_list_view/controllers/custom_list_view.py b/custom_list_view/controllers/custom_list_view.py new file mode 100644 index 000000000..e1290bf72 --- /dev/null +++ b/custom_list_view/controllers/custom_list_view.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 ExportData(http.Controller): + """ Controller class for exporting data from Odoo models.""" + @http.route('/get_data', auth="user", type='json') + def get_export_data(self, **kw): + """Controller method to fetch required details and export data. + :param kw: Dictionary containing the following keys: + - fields: List of fields to export + - model: Name of the Odoo model + - res_ids: List of record IDs to export (optional) + - domain: Domain for record filtering (optional) + :return: Dictionary containing exported data and column headers""" + model = request.env[kw['model']] + field_names = [field['name'] for field in kw['fields']] + columns_headers = [val['label'].strip() for val in kw['fields']] + domain = [('id', 'in', kw['res_ids'])] \ + if kw['res_ids'] else kw['domain'] + records = model.browse(kw['res_ids']) \ + if kw['res_ids'] \ + else model.search(domain, offset=0, limit=False, order=False) + export_data = records.export_data(field_names).get('datas', []) + return {'data': export_data, 'header': columns_headers} + + @http.route('/get_data/copy', auth="user", type='json') + def get_export_data_copy(self, **kw): + """Controller method to fetch required details, export data, and add + column headers. + :param kw: Dictionary containing the following keys: + - fields: List of fields to export + - model: Name of the Odoo model + - res_ids: List of record IDs to export (optional) + - domain: Domain for record filtering (optional) + :return: List of lists containing exported data with column headers""" + model = request.env[kw['model']] + field_names = [field['name'] for field in kw['fields']] + columns_headers = [val['label'].strip() for val in kw['fields']] + domain = [('id', 'in', kw['res_ids'])] \ + if kw['res_ids'] else kw['domain'] + records = model.browse(kw['res_ids']) \ + if kw['res_ids'] \ + else model.search(domain, offset=0, limit=False, order=False) + export_data = records.export_data(field_names).get('datas', []) + export_data.insert(0, columns_headers) + return export_data diff --git a/custom_list_view/doc/RELEASE_NOTES.md b/custom_list_view/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..79ddf5b15 --- /dev/null +++ b/custom_list_view/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 26.03.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial Commit for Custom List View + diff --git a/custom_list_view/report/custom_list_view_reports.xml b/custom_list_view/report/custom_list_view_reports.xml new file mode 100644 index 000000000..481be12d3 --- /dev/null +++ b/custom_list_view/report/custom_list_view_reports.xml @@ -0,0 +1,13 @@ + + + + + Export + ir.exports + qweb-pdf + custom_list_view.print_pdf_listview + custom_list_view.print_pdf_listview + Pdf Report - ${object.name} + report + + diff --git a/custom_list_view/report/custom_list_view_templates.xml b/custom_list_view/report/custom_list_view_templates.xml new file mode 100644 index 000000000..edee976ec --- /dev/null +++ b/custom_list_view/report/custom_list_view_templates.xml @@ -0,0 +1,31 @@ + + + + + diff --git a/custom_list_view/static/description/assets/icons/capture (1).png b/custom_list_view/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/custom_list_view/static/description/assets/icons/capture (1).png differ diff --git a/custom_list_view/static/description/assets/icons/check.png b/custom_list_view/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/custom_list_view/static/description/assets/icons/check.png differ diff --git a/custom_list_view/static/description/assets/icons/chevron.png b/custom_list_view/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/chevron.png differ diff --git a/custom_list_view/static/description/assets/icons/cogs.png b/custom_list_view/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/cogs.png differ diff --git a/custom_list_view/static/description/assets/icons/consultation.png b/custom_list_view/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/custom_list_view/static/description/assets/icons/consultation.png differ diff --git a/custom_list_view/static/description/assets/icons/ecom-black.png b/custom_list_view/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/ecom-black.png differ diff --git a/custom_list_view/static/description/assets/icons/education-black.png b/custom_list_view/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/custom_list_view/static/description/assets/icons/education-black.png differ diff --git a/custom_list_view/static/description/assets/icons/hotel-black.png b/custom_list_view/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/custom_list_view/static/description/assets/icons/hotel-black.png differ diff --git a/custom_list_view/static/description/assets/icons/img.png b/custom_list_view/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/img.png differ diff --git a/custom_list_view/static/description/assets/icons/license.png b/custom_list_view/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/custom_list_view/static/description/assets/icons/license.png differ diff --git a/custom_list_view/static/description/assets/icons/lifebuoy.png b/custom_list_view/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/custom_list_view/static/description/assets/icons/lifebuoy.png differ diff --git a/custom_list_view/static/description/assets/icons/manufacturing-black.png b/custom_list_view/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/custom_list_view/static/description/assets/icons/manufacturing-black.png differ diff --git a/custom_list_view/static/description/assets/icons/photo-capture.png b/custom_list_view/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/photo-capture.png differ diff --git a/custom_list_view/static/description/assets/icons/pos-black.png b/custom_list_view/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/pos-black.png differ diff --git a/custom_list_view/static/description/assets/icons/puzzle.png b/custom_list_view/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/puzzle.png differ diff --git a/custom_list_view/static/description/assets/icons/restaurant-black.png b/custom_list_view/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/restaurant-black.png differ diff --git a/custom_list_view/static/description/assets/icons/service-black.png b/custom_list_view/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/custom_list_view/static/description/assets/icons/service-black.png differ diff --git a/custom_list_view/static/description/assets/icons/trading-black.png b/custom_list_view/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/custom_list_view/static/description/assets/icons/trading-black.png differ diff --git a/custom_list_view/static/description/assets/icons/training.png b/custom_list_view/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/custom_list_view/static/description/assets/icons/training.png differ diff --git a/custom_list_view/static/description/assets/icons/update.png b/custom_list_view/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/custom_list_view/static/description/assets/icons/update.png differ diff --git a/custom_list_view/static/description/assets/icons/user.png b/custom_list_view/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/custom_list_view/static/description/assets/icons/user.png differ diff --git a/custom_list_view/static/description/assets/icons/wrench.png b/custom_list_view/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/custom_list_view/static/description/assets/icons/wrench.png differ diff --git a/custom_list_view/static/description/assets/misc/Cybrosys R.png b/custom_list_view/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/custom_list_view/static/description/assets/misc/Cybrosys R.png differ diff --git a/custom_list_view/static/description/assets/misc/email.svg b/custom_list_view/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/custom_list_view/static/description/assets/misc/phone.svg b/custom_list_view/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/custom_list_view/static/description/assets/misc/star (1) 2.svg b/custom_list_view/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/custom_list_view/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_list_view/static/description/assets/misc/support (1) 1.svg b/custom_list_view/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_list_view/static/description/assets/misc/support-email.svg b/custom_list_view/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/custom_list_view/static/description/assets/misc/tick-mark.svg b/custom_list_view/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/custom_list_view/static/description/assets/misc/whatsapp 1.svg b/custom_list_view/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/custom_list_view/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_list_view/static/description/assets/misc/whatsapp.svg b/custom_list_view/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/custom_list_view/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/custom_list_view/static/description/assets/modules/1.png b/custom_list_view/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/custom_list_view/static/description/assets/modules/1.png differ diff --git a/custom_list_view/static/description/assets/modules/2.png b/custom_list_view/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/custom_list_view/static/description/assets/modules/2.png differ diff --git a/custom_list_view/static/description/assets/modules/3.png b/custom_list_view/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/custom_list_view/static/description/assets/modules/3.png differ diff --git a/custom_list_view/static/description/assets/modules/4.png b/custom_list_view/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/custom_list_view/static/description/assets/modules/4.png differ diff --git a/custom_list_view/static/description/assets/modules/5.png b/custom_list_view/static/description/assets/modules/5.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/custom_list_view/static/description/assets/modules/5.png differ diff --git a/custom_list_view/static/description/assets/modules/6.png b/custom_list_view/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/custom_list_view/static/description/assets/modules/6.png differ diff --git a/custom_list_view/static/description/assets/screenshots/1.png b/custom_list_view/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..8d5697c11 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshots/1.png differ diff --git a/custom_list_view/static/description/assets/screenshots/2.png b/custom_list_view/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..e6f3ad5c2 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshots/2.png differ diff --git a/custom_list_view/static/description/assets/screenshots/3.png b/custom_list_view/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..1b24adbe9 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshots/3.png differ diff --git a/custom_list_view/static/description/assets/screenshots/4.png b/custom_list_view/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8df156993 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshots/4.png differ diff --git a/custom_list_view/static/description/assets/screenshots/hero.gif b/custom_list_view/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d32f98ea6 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshots/hero.gif differ diff --git a/custom_list_view/static/description/banner.png b/custom_list_view/static/description/banner.png new file mode 100644 index 000000000..a140cf6c6 Binary files /dev/null and b/custom_list_view/static/description/banner.png differ diff --git a/custom_list_view/static/description/icon.png b/custom_list_view/static/description/icon.png new file mode 100644 index 000000000..321534004 Binary files /dev/null and b/custom_list_view/static/description/icon.png differ diff --git a/custom_list_view/static/description/index.html b/custom_list_view/static/description/index.html new file mode 100644 index 000000000..79066c7da --- /dev/null +++ b/custom_list_view/static/description/index.html @@ -0,0 +1,599 @@ + + + + + + Custom List View + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Custom List View

+

+ Show Row Number in List View. Export List to Pdf, Excel + and CSV. Copy to Clipboard and Pagination. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Row Numbers.

+

+ Row Numbers in List Views. +

+
+
+
+
+
+
+ +
+
+

Export list in different formats.

+

+ Export list to PDF, CSV & Excel. +

+
+
+
+
+
+
+ +
+
+

Copy List values.

+

+ Copy List values to clipboard. +

+
+
+
+
+
+
+ +
+
+

pagination.

+

+ Datatable pagination. +

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

+ Row Numbers in List Views.

+
+
+
+
+
+
+ +
+
+

+ Export ,Copy to Clipboard.

+
+
+
+
+
+
+ +
+
+

+ Pagination.

+
+
+
+
+
+
+ +
+
+

+ Copy to Clipboard.

+
+
+
+
+
+
+
    +
  • + Row Numbers in List Views. +
  • +
  • + Export list to PDF, CSV & Excel. +
  • +
  • + Copy List values to clipboard. +
  • +
  • + Datatable pagination. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:4th Dec 2023 +
+

+ Initial Commit for Custom List View.

+
+
+
+
+ +
+
+

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/custom_list_view/static/src/js/list_controller.js b/custom_list_view/static/src/js/list_controller.js new file mode 100644 index 000000000..e336a33ce --- /dev/null +++ b/custom_list_view/static/src/js/list_controller.js @@ -0,0 +1,158 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { ListController } from '@web/views/list/list_controller'; +import { download } from "@web/core/network/download"; +import { jsonrpc } from "@web/core/network/rpc_service"; +import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { _t } from "@web/core/l10n/translation"; + +patch(ListController.prototype, { +// /** +// * Handle the click event for exporting data to a PDF. +// */ + _onClickPDF: async function() { + var self = this; + // Retrieve the fields to export + const fields = this.props.archInfo.columns + .filter((col) => ( + (col.optional === false || col.optional === "show") && + col.invisible !== "True" + )).map((col) => this.props.fields[col.name]); + const exportFields = fields.map((field) => ({ + name: field.name, + label: field.label || field.string, + })); + const resIds = await this.getSelectedResIds(); + var length_field = Array.from(Array(exportFields.length).keys()); + // Make a JSON-RPC request to retrieve the data for the report + jsonrpc('/get_data', { + 'model': this.model.root.resModel, + 'res_ids': resIds.length > 0 && resIds, + 'fields': exportFields, + 'grouped_by': this.model.root.groupBy, + 'context': this.props.context, + 'domain': this.model.root.domain, + 'context': this.props.context, + }).then(function(data) { + var model = self.model.root.resModel + // Generate and download the PDF report + return self.model.action.doAction({ + type: "ir.actions.report", + report_type: "qweb-pdf", + report_name: 'custom_list_view.print_pdf_listview', + report_file: "custom_list_view.print_pdf_listview", + data: { + 'length': length_field, + 'record': data + } + }); + }); + }, + /** + * Handle the click event for exporting data to Excel. + */ + _onClickExcel: async function() { + // Retrieve the fields to export + const fields = this.props.archInfo.columns + .filter((col) => ( + (col.optional === false || col.optional === "show") && + col.invisible !== "True" + )).map((col) => this.props.fields[col.name]); + const exportFields = fields.map((field) => ({ + name: field.name, + label: field.label || field.string, + store: field.store, + type: field.field_type || field.type, + })); + const resIds = await this.getSelectedResIds(); + const import_compat = false + // Make a request to download the Excel file + await download({ + data: { + data: JSON.stringify({ + import_compat, + context: this.props.context, + domain: this.model.root.domain, + fields: exportFields, + groupby: this.model.root.groupBy, + ids: resIds.length > 0 && resIds, + model: this.model.root.resModel, + }), + }, + url: `/web/export/xlsx`, + }); + }, + /** + * Handle the click event for exporting data to CSV. + */ + _onClickCSV: async function() { + const fields = this.props.archInfo.columns + .filter((col) => ( + (col.optional === false || col.optional === "show") && + col.invisible !== "True" + )).map((col) => this.props.fields[col.name]); + const exportFields = fields.map((field) => ({ + name: field.name, + label: field.label || field.string, + store: field.store, + type: field.field_type || field.type, + })); + const resIds = await this.getSelectedResIds(); + const import_compat = false + // Make a request to download the CSV file + await download({ + data: { + data: JSON.stringify({ + import_compat, + context: this.props.context, + domain: this.model.root.domain, + fields: exportFields, + groupby: this.model.root.groupBy, + ids: resIds.length > 0 && resIds, + model: this.model.root.resModel, + }), + }, + url: `/web/export/csv`, + }); + }, + /** + * Handle the click event for copying data to the clipboard. + */ + _onClickCopy: async function() { + var self = this; + // Retrieve the fields to export + const fields = this.props.archInfo.columns + .filter((col) => ( + (col.optional === false || col.optional === "show") && + col.invisible !== "True" + )).map((col) => this.props.fields[col.name]); + const exportFields = fields.map((field) => ({ + name: field.name, + label: field.label || field.string, + })); + const resIds = await this.getSelectedResIds(); + var length_field = Array.from(Array(exportFields.length).keys()); + // Make a JSON-RPC request to retrieve the data to copy + jsonrpc('/get_data/copy', { + 'model': this.model.root.resModel, + 'res_ids': resIds.length > 0 && resIds, + 'fields': exportFields, + 'grouped_by': this.model.root.groupBy, + 'context': this.props.context, + 'domain': this.model.root.domain, + 'context': this.props.context, + }).then(function(data) { + // Format the data as text and copy it to the clipboard + var recText = data.map(function(record) { + return record.join("\t"); // Join the elements of each array with tabs ("\t") + }).join("\n"); + // Copy the recText to the clipboard + navigator.clipboard.writeText(recText); + self.dialogService.add(AlertDialog, { + title: _t('Copied !!'), + body: _t("Records Copied to Clipboard."), + confirmLabel: _t('Ok'), + }); + }); + }, +}); diff --git a/custom_list_view/static/src/js/list_renderer.js b/custom_list_view/static/src/js/list_renderer.js new file mode 100644 index 000000000..8cb493cb9 --- /dev/null +++ b/custom_list_view/static/src/js/list_renderer.js @@ -0,0 +1,21 @@ +/** @odoo-module **/ +import { ListRenderer } from "@web/views/list/list_renderer"; +import { patch } from "@web/core/utils/patch"; +/** + * Patched function to toggle record selection and add a CSS class to selected records. + * + * @param {Object} record - The record to toggle selection for. + */ +patch(ListRenderer.prototype, { + toggleRecordSelection(record, ev) { + var self = this; + const result = super.toggleRecordSelection(...arguments); + var selectedRecord = $(event.target).closest('tr') + if ($(event.target).prop('checked')) { + selectedRecord.addClass('selected_record'); + } else { + selectedRecord.removeClass('selected_record') + } + return result + } +}); diff --git a/custom_list_view/static/src/xml/list_controller.xml b/custom_list_view/static/src/xml/list_controller.xml new file mode 100644 index 000000000..3a8845178 --- /dev/null +++ b/custom_list_view/static/src/xml/list_controller.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + +