diff --git a/auto_fill/README.rst b/auto_fill/README.rst new file mode 100644 index 000000000..61b2f30f4 --- /dev/null +++ b/auto_fill/README.rst @@ -0,0 +1,59 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Auto Fill Widget +================ +* Widget for showing the suggestions to a character field +* Widget = **auto_fill** + +Developer +========= +* Developer: + odoo v11 Avinash Nk (odoo@cybrosys.com) + odoo v12 Akshay Babu + odoo v13 Mruthul Raj +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +Credits +------- +Developers: Version 16 - Mruthul @cybrosys, +Contact: odoo@cybrosys.com + + +Bug Tracker +=========== + +Contact odoo@cybrosys.com + + +Contributors +------------ + +* Mruthul Raj + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + + +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: ``__ \ No newline at end of file diff --git a/auto_fill/__init__.py b/auto_fill/__init__.py new file mode 100644 index 000000000..1605538eb --- /dev/null +++ b/auto_fill/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies (). +# Author: Mruthul Raj() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import controllers diff --git a/auto_fill/__manifest__.py b/auto_fill/__manifest__.py new file mode 100644 index 000000000..a4f9ee6f9 --- /dev/null +++ b/auto_fill/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies (). +# Author: Mruthul Raj() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Auto Fill Widget', + 'version': '13.0.1.0.0', + 'summary': """Widget that suggests field value from existing records""", + 'description': 'Widget for auto completing a character field according' + ' to its existing record values', + 'category': 'Extra Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base'], + 'maintainer': 'Cybrosys Techno Solutions', + 'qweb': ['static/src/xml/auto_fill.xml'], + 'data': ['views/assets.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/auto_fill/controllers/__init__.py b/auto_fill/controllers/__init__.py new file mode 100644 index 000000000..4e3b56108 --- /dev/null +++ b/auto_fill/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies (). +# Author: Mruthul Raj() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import auto_fill diff --git a/auto_fill/controllers/auto_fill.py b/auto_fill/controllers/auto_fill.py new file mode 100644 index 000000000..bc2f1d29c --- /dev/null +++ b/auto_fill/controllers/auto_fill.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies (). +# Author: Mruthul Raj() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import http +from odoo.http import request + + +class MatchingRecords(http.Controller): + """ + Controller class to get matching records based on provided criteria. + """ + @http.route(['/matching/records'], type='json', auth="none") + def get_matching_records(self, **kwargs): + """ + Retrieve matching records based on the provided model, field, and value. + Returns: + list: List of matching records. + """ + model = str(kwargs['model']) + field = str(kwargs['field']) + model = model.replace(".", "_") + if len(str(kwargs['value'])) > 0: + query = f"SELECT {field} FROM {model} WHERE " \ + f"{field} ~* '{str(kwargs['value'])}' GROUP BY {field}" + request.cr.execute(query) + res = request.cr.fetchall() + else: + res = [] + return res diff --git a/auto_fill/doc/RELEASE_NOTES.md b/auto_fill/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..0b522e7c9 --- /dev/null +++ b/auto_fill/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 04.07.2023 +#### Version 13.0.1.0.0 +##### ADD +- Initial Commit for Auto Fill \ No newline at end of file diff --git a/auto_fill/static/description/assets/icons/check.png b/auto_fill/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/auto_fill/static/description/assets/icons/check.png differ diff --git a/auto_fill/static/description/assets/icons/chevron.png b/auto_fill/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/auto_fill/static/description/assets/icons/chevron.png differ diff --git a/auto_fill/static/description/assets/icons/cogs.png b/auto_fill/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/auto_fill/static/description/assets/icons/cogs.png differ diff --git a/auto_fill/static/description/assets/icons/consultation.png b/auto_fill/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/auto_fill/static/description/assets/icons/consultation.png differ diff --git a/auto_fill/static/description/assets/icons/ecom-black.png b/auto_fill/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/auto_fill/static/description/assets/icons/ecom-black.png differ diff --git a/auto_fill/static/description/assets/icons/education-black.png b/auto_fill/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/auto_fill/static/description/assets/icons/education-black.png differ diff --git a/auto_fill/static/description/assets/icons/hotel-black.png b/auto_fill/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/auto_fill/static/description/assets/icons/hotel-black.png differ diff --git a/auto_fill/static/description/assets/icons/license.png b/auto_fill/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/auto_fill/static/description/assets/icons/license.png differ diff --git a/auto_fill/static/description/assets/icons/lifebuoy.png b/auto_fill/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/auto_fill/static/description/assets/icons/lifebuoy.png differ diff --git a/auto_fill/static/description/assets/icons/logo.png b/auto_fill/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/auto_fill/static/description/assets/icons/logo.png differ diff --git a/auto_fill/static/description/assets/icons/manufacturing-black.png b/auto_fill/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/auto_fill/static/description/assets/icons/manufacturing-black.png differ diff --git a/auto_fill/static/description/assets/icons/pos-black.png b/auto_fill/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/auto_fill/static/description/assets/icons/pos-black.png differ diff --git a/auto_fill/static/description/assets/icons/puzzle.png b/auto_fill/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/auto_fill/static/description/assets/icons/puzzle.png differ diff --git a/auto_fill/static/description/assets/icons/restaurant-black.png b/auto_fill/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/auto_fill/static/description/assets/icons/restaurant-black.png differ diff --git a/auto_fill/static/description/assets/icons/service-black.png b/auto_fill/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/auto_fill/static/description/assets/icons/service-black.png differ diff --git a/auto_fill/static/description/assets/icons/trading-black.png b/auto_fill/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/auto_fill/static/description/assets/icons/trading-black.png differ diff --git a/auto_fill/static/description/assets/icons/training.png b/auto_fill/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/auto_fill/static/description/assets/icons/training.png differ diff --git a/auto_fill/static/description/assets/icons/update.png b/auto_fill/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/auto_fill/static/description/assets/icons/update.png differ diff --git a/auto_fill/static/description/assets/icons/user.png b/auto_fill/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/auto_fill/static/description/assets/icons/user.png differ diff --git a/auto_fill/static/description/assets/icons/wrench.png b/auto_fill/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/auto_fill/static/description/assets/icons/wrench.png differ diff --git a/auto_fill/static/description/assets/modules/appraisal_image.png b/auto_fill/static/description/assets/modules/appraisal_image.png new file mode 100644 index 000000000..0823d44d3 Binary files /dev/null and b/auto_fill/static/description/assets/modules/appraisal_image.png differ diff --git a/auto_fill/static/description/assets/modules/bio_image.png b/auto_fill/static/description/assets/modules/bio_image.png new file mode 100644 index 000000000..acc34b287 Binary files /dev/null and b/auto_fill/static/description/assets/modules/bio_image.png differ diff --git a/auto_fill/static/description/assets/modules/core_image.gif b/auto_fill/static/description/assets/modules/core_image.gif new file mode 100644 index 000000000..814b0cfd3 Binary files /dev/null and b/auto_fill/static/description/assets/modules/core_image.gif differ diff --git a/auto_fill/static/description/assets/modules/dash_image.gif b/auto_fill/static/description/assets/modules/dash_image.gif new file mode 100644 index 000000000..f5cac4e13 Binary files /dev/null and b/auto_fill/static/description/assets/modules/dash_image.gif differ diff --git a/auto_fill/static/description/assets/modules/export_stock.png b/auto_fill/static/description/assets/modules/export_stock.png new file mode 100644 index 000000000..a8dade6e9 Binary files /dev/null and b/auto_fill/static/description/assets/modules/export_stock.png differ diff --git a/auto_fill/static/description/assets/modules/fleet_report.png b/auto_fill/static/description/assets/modules/fleet_report.png new file mode 100644 index 000000000..67d671382 Binary files /dev/null and b/auto_fill/static/description/assets/modules/fleet_report.png differ diff --git a/auto_fill/static/description/assets/modules/individual_product.png b/auto_fill/static/description/assets/modules/individual_product.png new file mode 100644 index 000000000..9e5f9363b Binary files /dev/null and b/auto_fill/static/description/assets/modules/individual_product.png differ diff --git a/auto_fill/static/description/assets/modules/print_workorder.png b/auto_fill/static/description/assets/modules/print_workorder.png new file mode 100644 index 000000000..bfdcc96c0 Binary files /dev/null and b/auto_fill/static/description/assets/modules/print_workorder.png differ diff --git a/auto_fill/static/description/assets/modules/project_report.png b/auto_fill/static/description/assets/modules/project_report.png new file mode 100644 index 000000000..46288555e Binary files /dev/null and b/auto_fill/static/description/assets/modules/project_report.png differ diff --git a/auto_fill/static/description/assets/modules/salary_image.png b/auto_fill/static/description/assets/modules/salary_image.png new file mode 100644 index 000000000..127ea73a8 Binary files /dev/null and b/auto_fill/static/description/assets/modules/salary_image.png differ diff --git a/auto_fill/static/description/assets/modules/shift_image.png b/auto_fill/static/description/assets/modules/shift_image.png new file mode 100644 index 000000000..9d6978271 Binary files /dev/null and b/auto_fill/static/description/assets/modules/shift_image.png differ diff --git a/auto_fill/static/description/assets/modules/timesheet_emp.png b/auto_fill/static/description/assets/modules/timesheet_emp.png new file mode 100644 index 000000000..2c4c891a0 Binary files /dev/null and b/auto_fill/static/description/assets/modules/timesheet_emp.png differ diff --git a/auto_fill/static/description/assets/screenshots/auto_fill _.gif b/auto_fill/static/description/assets/screenshots/auto_fill _.gif new file mode 100644 index 000000000..78149aff1 Binary files /dev/null and b/auto_fill/static/description/assets/screenshots/auto_fill _.gif differ diff --git a/auto_fill/static/description/assets/screenshots/hero.png b/auto_fill/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..df0ac9ab5 Binary files /dev/null and b/auto_fill/static/description/assets/screenshots/hero.png differ diff --git a/auto_fill/static/description/assets/screenshots/widget.png b/auto_fill/static/description/assets/screenshots/widget.png new file mode 100644 index 000000000..5821926c7 Binary files /dev/null and b/auto_fill/static/description/assets/screenshots/widget.png differ diff --git a/auto_fill/static/description/banner.jpg b/auto_fill/static/description/banner.jpg new file mode 100644 index 000000000..473718694 Binary files /dev/null and b/auto_fill/static/description/banner.jpg differ diff --git a/auto_fill/static/description/cybro_logo.png b/auto_fill/static/description/cybro_logo.png new file mode 100755 index 000000000..bb309114c Binary files /dev/null and b/auto_fill/static/description/cybro_logo.png differ diff --git a/auto_fill/static/description/icon.png b/auto_fill/static/description/icon.png new file mode 100644 index 000000000..9a353ea59 Binary files /dev/null and b/auto_fill/static/description/icon.png differ diff --git a/auto_fill/static/description/index.html b/auto_fill/static/description/index.html new file mode 100644 index 000000000..cb4066316 --- /dev/null +++ b/auto_fill/static/description/index.html @@ -0,0 +1,641 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Auto Fill Widget

+

+ Widget that suggests field value from existing records +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ Widget for auto completing a character field according to its + existing record values.

+ +
+
+
+
+

+ Configuration +

+
+ +
+

+ After installing the module, you can put the tag + widget="auto_fill" in your form view.

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Can insert for any char fields

+ +
+
+
+
+ +
+
+

+ Fast Result

+ +
+
+ +
+
+ +
+
+

+ Attractive Design

+ +
+
+ +
+
+ +
+
+

+ Widget = auto_fill

+ +
+
+ + +
+ +
+
+

+ Screenshots +

+
+
+

+ Add widget="auto_fill"

+ + +
+
+

+ Values that was added before wil be shown like this

+ + +
+ + +
+ + +
+
+

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?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/auto_fill/static/src/css/auto_fill.css b/auto_fill/static/src/css/auto_fill.css new file mode 100644 index 000000000..7419d8fb0 --- /dev/null +++ b/auto_fill/static/src/css/auto_fill.css @@ -0,0 +1,31 @@ +.auto-fill-scrollbar { + z-index: 1051; + position: absolute; + background: #ffffff; + overflow-y: scroll; + height: auto; + display:none; + width:auto !important; + border: 1px solid #E5E5E5; + font-size: 13px; + padding: 5px 0px; + box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.176); +} +.auto-fill-scrollbar td { + padding-left: 7px !important; + padding-right: 7px !important; +} +.auto-fill-scrollbar td:hover{ + background: #2d6cb3; + color: #fff; +} +.list_matches{ + width: 100%; + cursor: pointer; +} +.input_field_auto_fill { + border: 1px solid #D2D2FF; +} +.text_field_auto_fill { + border: 1px solid #D2D2FF; +} diff --git a/auto_fill/static/src/js/auto_fill.js b/auto_fill/static/src/js/auto_fill.js new file mode 100644 index 000000000..3768ebb8f --- /dev/null +++ b/auto_fill/static/src/js/auto_fill.js @@ -0,0 +1,71 @@ +odoo.define('auto_fill.AutoFill', function (require) { + "use strict"; + var ajax = require('web.ajax'); + var basic_fields = require('web.basic_fields'); + var registry = require('web.field_registry'); + var CharField = require('web.basic_fields').FieldChar; + var FieldAutoFill = CharField.extend({ + template: 'FieldAutoFill', + events: _.extend({}, CharField.prototype.events, { + 'keyup': '_onKeyup', + 'click #list_matches': '_onTableRowClicked', + }), + /** + * Render the field in readonly mode. + */ + _renderReadonly: function () { + var show_value = this._formatValue(this.value); + this.$el.text(show_value); + }, + /** + * Get the current field value. + * @returns {string} The field value. + */ + _getValue: function () { + var $input = this.$el.find('input'); + return $input.val(); + }, + /** + * Event handler for the keyup event. + * Performs AJAX request to retrieve matching records based on the input value. + */ + _onKeyup: function (ev) { + var value = ev.target.value; + var self = this; + ajax.jsonRpc('/matching/records', 'call', { + model: this.model, + field: this.name, + value: value, + }).then(function (result){ + if (result.length > 0){ + self.el.lastElementChild.style.display = 'block' + var table = self.el.lastElementChild.children[0]; + $(table).find('tr').remove(); + var i; + for (i = 0; i < result.length; i++) { + var row = table.insertRow(i); + var cell = row.insertCell(0); + cell.innerHTML = result[i]; + } + } + else { + self.el.lastElementChild.style.display = 'none' + } + }) ; + }, + /** + * Event handler for clicking on a table row. + * Updates the input field value with the clicked row's content. + * + * @param {Event} ev - The click event. + */ + _onTableRowClicked: function (ev) { + this.el.firstElementChild.firstElementChild.value = ev.target.textContent; + this.el.lastElementChild.style.display = 'none' + }, + }); + registry.add('auto_fill', FieldAutoFill); + return { + FieldAutoFill: FieldAutoFill, + }; +}); \ No newline at end of file diff --git a/auto_fill/static/src/xml/auto_fill.xml b/auto_fill/static/src/xml/auto_fill.xml new file mode 100644 index 000000000..261333062 --- /dev/null +++ b/auto_fill/static/src/xml/auto_fill.xml @@ -0,0 +1,27 @@ + + + + +
+ + +
+ +
+
+ +
+