diff --git a/custom_list_view/README.rst b/custom_list_view/README.rst new file mode 100644 index 000000000..c63feeebd --- /dev/null +++ b/custom_list_view/README.rst @@ -0,0 +1,14 @@ +Custom List View V14 +==================== + +This module will helps to show row number, fixed header, duplicate record and highlight selected record in list view + + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Cybrosys Techno Solutions + Aiswarya J P @ Cybro \ No newline at end of file diff --git a/custom_list_view/__init__.py b/custom_list_view/__init__.py new file mode 100644 index 000000000..e2604cae1 --- /dev/null +++ b/custom_list_view/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-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 . +# +############################################################################# diff --git a/custom_list_view/__manifest__.py b/custom_list_view/__manifest__.py new file mode 100644 index 000000000..3f791f057 --- /dev/null +++ b/custom_list_view/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-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': '14.0.1.0.0', + 'summary': 'Helps to Show Row Number, Fixed Header, Duplicate Record and Highlight Selected Record in List View', + 'description': 'Helps to Show Row Number, Fixed Header, Duplicate Record and Highlight Selected Record in List View', + 'category': 'Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'license': 'LGPL-3', + 'images': ['static/description/banner.png'], + 'depends': ['base'], + 'data': [ + 'views/assets.xml', + ], + 'installable': True, + 'auto_install': False, + 'application': False, +} \ No newline at end of file diff --git a/custom_list_view/doc/RELEASE_NOTES.md b/custom_list_view/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9a071071e --- /dev/null +++ b/custom_list_view/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 20.04.2022 +#### Version 14.0.1.0.0 +#### ADD Initial Commit for custom_list_view 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/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/logo.png b/custom_list_view/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/custom_list_view/static/description/assets/icons/logo.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/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/modules/budget_image.png b/custom_list_view/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/custom_list_view/static/description/assets/modules/budget_image.png differ diff --git a/custom_list_view/static/description/assets/modules/credit_image.png b/custom_list_view/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/custom_list_view/static/description/assets/modules/credit_image.png differ diff --git a/custom_list_view/static/description/assets/modules/employee_image.png b/custom_list_view/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/custom_list_view/static/description/assets/modules/employee_image.png differ diff --git a/custom_list_view/static/description/assets/modules/export_image.png b/custom_list_view/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/custom_list_view/static/description/assets/modules/export_image.png differ diff --git a/custom_list_view/static/description/assets/modules/gantt_image.png b/custom_list_view/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/custom_list_view/static/description/assets/modules/gantt_image.png differ diff --git a/custom_list_view/static/description/assets/modules/quotation_image.png b/custom_list_view/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/custom_list_view/static/description/assets/modules/quotation_image.png differ diff --git a/custom_list_view/static/description/assets/screenshot/duplicate_record.png b/custom_list_view/static/description/assets/screenshot/duplicate_record.png new file mode 100644 index 000000000..2d18fc5fe Binary files /dev/null and b/custom_list_view/static/description/assets/screenshot/duplicate_record.png differ diff --git a/custom_list_view/static/description/assets/screenshot/hero.png b/custom_list_view/static/description/assets/screenshot/hero.png new file mode 100644 index 000000000..b8b127660 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshot/hero.png differ diff --git a/custom_list_view/static/description/assets/screenshot/highlight_record.png b/custom_list_view/static/description/assets/screenshot/highlight_record.png new file mode 100644 index 000000000..9ffc2baa9 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshot/highlight_record.png differ diff --git a/custom_list_view/static/description/assets/screenshot/row_number.png b/custom_list_view/static/description/assets/screenshot/row_number.png new file mode 100644 index 000000000..a90da3db2 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshot/row_number.png differ diff --git a/custom_list_view/static/description/assets/screenshot/sticky_header.png b/custom_list_view/static/description/assets/screenshot/sticky_header.png new file mode 100644 index 000000000..0bf7a61b1 Binary files /dev/null and b/custom_list_view/static/description/assets/screenshot/sticky_header.png 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..f0fd5ad5c 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..2726a5440 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..58cbc2194 --- /dev/null +++ b/custom_list_view/static/description/index.html @@ -0,0 +1,588 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Custom List View

+

+ Helps to Show Row Number, Fixed Header, Duplicate Record and Highlight Selected Record in List View +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ This module will ensure sticky headers, row numbers, duplicate records and record highlight for list + view and enhance the user experience.

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Sticky Header in List Views

+
+
+
+
+ +
+
+

+ Row Numbers in List Views

+
+
+ + +
+
+ +
+
+

+ Able to Duplicate Records from List Views.

+
+
+
+
+ +
+
+

+ Able to Highlight Selected Records in list view +

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ Sticky Header in List Views

+ +
+
+

+ Row Numbers in List Views

+ +
+
+

+ Duplicate Records From List Views

+ +
+
+

+ Highlight Records From List Views

+ +
+ + +
+ + +
+
+

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/custom_list_view/static/src/css/highlight.css b/custom_list_view/static/src/css/highlight.css new file mode 100644 index 000000000..9e9b50674 --- /dev/null +++ b/custom_list_view/static/src/css/highlight.css @@ -0,0 +1,5 @@ + +.o_list_view tr.o_data_row.selected_record { + background-color: #7c7aad; + color:#ffffff +} \ No newline at end of file diff --git a/custom_list_view/static/src/css/sticky_header.css b/custom_list_view/static/src/css/sticky_header.css new file mode 100644 index 000000000..4e2399093 --- /dev/null +++ b/custom_list_view/static/src/css/sticky_header.css @@ -0,0 +1,8 @@ +.o_list_view .o_list_table thead { + position: sticky; + top: 0; + z-index:999; +} +.o_list_view .table-responsive .table thead{ +z-index: 1; +} diff --git a/custom_list_view/static/src/js/duplicate_record.js b/custom_list_view/static/src/js/duplicate_record.js new file mode 100644 index 000000000..fca519011 --- /dev/null +++ b/custom_list_view/static/src/js/duplicate_record.js @@ -0,0 +1,126 @@ +odoo.define('custom_list_view.ListController', function (require) { +"use strict"; + +var core = require('web.core'); +var ListController = require('web.ListController'); +var DataExport = require('web.DataExport'); +var Dialog = require('web.Dialog'); +var ListConfirmDialog = require('web.ListConfirmDialog'); +var session = require('web.session'); +const viewUtils = require('web.viewUtils'); +var _t = core._t; +var qweb = core.qweb; + +var duplicate={ + + init: function (parent, model, renderer, params) { + this._super.apply(this, arguments); + this.hasActionMenus = params.hasActionMenus; + }, + willStart() { + const sup = this._super(...arguments); + const acl = session.user_has_group('base.group_allow_export').then(hasGroup => { + this.isExportEnable = hasGroup; + }); + return Promise.all([sup, acl]); + }, + _onDuplicateRecord: function () { + var self = this; + var def = []; + var ids = this.selectedRecords + _.each(ids, function (id) { + def.push(self.model.duplicateRecord(id)); + }); + return $.when.apply($, def).done(function () { + self.reload(); + }); + }, + _discardChanges: function (recordID) { + if ((recordID || this.handle) === this.handle) { + recordID = this.renderer.getEditableRecordID(); + if (recordID === null) { + return Promise.resolve(); + } + } + var self = this; + return this._super(recordID).then(function () { + self.updateButtons('readonly'); + }); + }, + _domainToResIds: function (domain, limit) { + return this._rpc({ + model: this.modelName, + method: 'search', + args: [domain], + kwargs: { + limit: limit, + }, + }); + }, + _getExportDialogWidget() { + let state = this.model.get(this.handle); + let defaultExportFields = this.renderer.columns.filter(field => field.tag === 'field').map(field => field.attrs.name); + let groupedBy = this.renderer.state.groupedBy; + const domain = this.isDomainSelected && state.getDomain(); + return new DataExport(this, state, defaultExportFields, groupedBy, + domain, this.getSelectedIds()); + }, + _getPagingInfo: function (state) { + if (!state.count) { + return null; + } + return this._super(...arguments); + }, + _getActionMenuItems: function (state) { + if (!this.hasActionMenus || !this.selectedRecords.length) { + return null; + } + const props = this._super(...arguments); + const otherActionItems = []; + if (this.isExportEnable) { + otherActionItems.push({ + description: _t("Export"), + callback: () => this._onExportData() + }); + } + if (this.archiveEnabled) { + otherActionItems.push({ + description: _t("Archive"), + callback: () => { + Dialog.confirm(this, _t("Are you sure that you want to archive all the selected records?"), { + confirm_callback: () => this._toggleArchiveState(true), + }); + } + }, { + description: _t("Unarchive"), + callback: () => this._toggleArchiveState(false) + }); + } + if (this.activeActions.delete) { + otherActionItems.push({ + description: _t("Delete"), + callback: () => this._onDeleteSelectedRecords() + }); + } + if (this.activeActions.delete) { + otherActionItems.push({ + description: _t("Duplicate"), + callback: () => this._onDuplicateSelectedRecords() + }); + } + + return Object.assign(props, { + items: Object.assign({}, this.toolbarActions, { other: otherActionItems }), + context: state.getContext(), + domain: state.getDomain(), + isDomainSelected: this.isDomainSelected, + }); + }, + _onDuplicateSelectedRecords: async function () { + + this._onDuplicateRecord(); + + }, + }; +ListController.include(duplicate) +}); diff --git a/custom_list_view/static/src/js/record_highlight.js b/custom_list_view/static/src/js/record_highlight.js new file mode 100644 index 000000000..a32838c02 --- /dev/null +++ b/custom_list_view/static/src/js/record_highlight.js @@ -0,0 +1,20 @@ +odoo.define('custom_list_view.record_highlighted', function (require) { +"use strict"; + + var ListRenderer = require("web.ListRenderer"); + + ListRenderer.include({ + + _onSelectRecord: function (event) { + + var self = this; + this._super.apply(this, arguments); + var $selectedRecord = $(event.target).closest('tr') + if($(event.target).prop('checked')){ + $selectedRecord.addClass('selected_record'); + } else { + $selectedRecord.removeClass('selected_record') + } + }, + }); +}); diff --git a/custom_list_view/static/src/js/serial_no.js b/custom_list_view/static/src/js/serial_no.js new file mode 100644 index 000000000..9432daefd --- /dev/null +++ b/custom_list_view/static/src/js/serial_no.js @@ -0,0 +1,39 @@ +odoo.define('custom_list_view.serial_no', function (require) { +"use strict"; + +var core = require('web.core'); +var ListRenderer = require('web.ListRenderer'); +var _t = core._t; + +ListRenderer.include({ + + _getNumberOfCols: function () { + var columns = this._super(); + columns +=1; + return columns; + }, + + + _renderFooter: function () { + const $footer = this._super.apply(this, arguments); + $footer.find('tr').prepend($('')); + return $footer; + }, + + _renderHeader: function () { + var $thead = this._super.apply(this, arguments); + if (this.hasSelectors) { + $thead.find('th.o_list_record_selector').before($('', {class: 'o_list_serial_number_header'}).html('SI.NO')); + } + return $thead; + }, + _renderRow: function (record) { + var $rows = this._super(record); + var index = this.state.data.indexOf(record) + if (this.hasSelectors) { + $rows.prepend($("").html(index+1)); + } + return $rows; + }, +}); +}); \ No newline at end of file diff --git a/custom_list_view/views/assets.xml b/custom_list_view/views/assets.xml new file mode 100644 index 000000000..340b0254d --- /dev/null +++ b/custom_list_view/views/assets.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file