diff --git a/fountain_widget_many2one/README.rst b/fountain_widget_many2one/README.rst new file mode 100755 index 000000000..ddc2e0cc1 --- /dev/null +++ b/fountain_widget_many2one/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 + +Fountain Widget +=============== +* This module introduce a new widget that is used to select the many2one field in fountain manner. + +Configuration +============= +No additional configurations needed. + +License +------- +Lesser General Public License, Version 3 (LGPL v3). + +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V16) Anusha C ,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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/fountain_widget_many2one/__init__.py b/fountain_widget_many2one/__init__.py new file mode 100644 index 000000000..a384311f2 --- /dev/null +++ b/fountain_widget_many2one/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anusha C (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 . +# +############################################################################### diff --git a/fountain_widget_many2one/__manifest__.py b/fountain_widget_many2one/__manifest__.py new file mode 100644 index 000000000..005fabd23 --- /dev/null +++ b/fountain_widget_many2one/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anusha C (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": "Fountain Widget", + "version": "16.0.1.0.0", + "category": 'Extra Tools', + "summary": "This widget is used to select the many2one field in fountain " + "manner.", + "description": "This is a widget for many2one fields. By using this " + "widget we can select record in a fountain manner. It " + "generates dynamic dropdown menus with hierarchical options " + "and thus Supports parent-child relationships between " + "dropdown options.", + "author": "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + "depends": ['base'], + 'assets': { + 'web.assets_backend': [ + 'fountain_widget_many2one/static/src/js/fountain_widget_many2one.js', + 'fountain_widget_many2one/static/src/xml/fountain_widget_many2one.xml', + 'fountain_widget_many2one/static/src/css/fountain_widget_many2one.css', + 'fountain_widget_many2one/static/src/css/fountain_widget_many2one.scss', + 'fountain_widget_many2one/static/src/xml/fountain_widget_component.xml', + 'fountain_widget_many2one/static/src/js/fountain_widget_component.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/fountain_widget_many2one/doc/RELEASE_NOTES.md b/fountain_widget_many2one/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..3e3a05073 --- /dev/null +++ b/fountain_widget_many2one/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module +#### 02.12.2023 +#### Version 16.0.1.0.0 +##### ADD + +- Initial Commit for Fountain Widget diff --git a/fountain_widget_many2one/static/description/assets/icons/check.png b/fountain_widget_many2one/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/check.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/chevron.png b/fountain_widget_many2one/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/chevron.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/cogs.png b/fountain_widget_many2one/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/cogs.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/consultation.png b/fountain_widget_many2one/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/consultation.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/ecom-black.png b/fountain_widget_many2one/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/ecom-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/education-black.png b/fountain_widget_many2one/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/education-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/hotel-black.png b/fountain_widget_many2one/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/hotel-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/license.png b/fountain_widget_many2one/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/license.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/lifebuoy.png b/fountain_widget_many2one/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/lifebuoy.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/manufacturing-black.png b/fountain_widget_many2one/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/manufacturing-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/pos-black.png b/fountain_widget_many2one/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/pos-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/puzzle.png b/fountain_widget_many2one/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/puzzle.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/restaurant-black.png b/fountain_widget_many2one/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/restaurant-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/service-black.png b/fountain_widget_many2one/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/service-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/trading-black.png b/fountain_widget_many2one/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/trading-black.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/training.png b/fountain_widget_many2one/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/training.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/update.png b/fountain_widget_many2one/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/update.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/user.png b/fountain_widget_many2one/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/user.png differ diff --git a/fountain_widget_many2one/static/description/assets/icons/wrench.png b/fountain_widget_many2one/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/icons/wrench.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/categories.png b/fountain_widget_many2one/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/categories.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/check-box.png b/fountain_widget_many2one/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/check-box.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/compass.png b/fountain_widget_many2one/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/compass.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/corporate.png b/fountain_widget_many2one/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/corporate.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/customer-support.png b/fountain_widget_many2one/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/customer-support.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/cybrosys-logo.png b/fountain_widget_many2one/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/cybrosys-logo.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/features.png b/fountain_widget_many2one/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/features.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/logo.png b/fountain_widget_many2one/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/logo.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/pictures.png b/fountain_widget_many2one/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/pictures.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/pie-chart.png b/fountain_widget_many2one/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/pie-chart.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/right-arrow.png b/fountain_widget_many2one/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/right-arrow.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/star.png b/fountain_widget_many2one/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/star.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/support.png b/fountain_widget_many2one/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/support.png differ diff --git a/fountain_widget_many2one/static/description/assets/misc/whatsapp.png b/fountain_widget_many2one/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/misc/whatsapp.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/1.png b/fountain_widget_many2one/static/description/assets/modules/1.png new file mode 100644 index 000000000..f40a0756d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/1.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/2.png b/fountain_widget_many2one/static/description/assets/modules/2.png new file mode 100644 index 000000000..42d7af8e6 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/2.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/3.png b/fountain_widget_many2one/static/description/assets/modules/3.png new file mode 100644 index 000000000..72ef14f87 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/3.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/4.png b/fountain_widget_many2one/static/description/assets/modules/4.png new file mode 100644 index 000000000..f764937d0 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/4.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/5.png b/fountain_widget_many2one/static/description/assets/modules/5.png new file mode 100644 index 000000000..16ad8ca2d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/5.png differ diff --git a/fountain_widget_many2one/static/description/assets/modules/6.jpg b/fountain_widget_many2one/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..9b0d92749 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/modules/6.jpg differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot1.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..7c8442dbc Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot1.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot2.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..0b5247d78 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot2.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot3.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..273e45b3f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot3.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot4.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..4a143e510 Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot4.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot5.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..3c47ff07d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot5.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot6.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..62c9f9a1c Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot6.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot7.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..502ec05ff Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot7.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/screenshot8.png b/fountain_widget_many2one/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..35a7c782f Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/screenshot8.png differ diff --git a/fountain_widget_many2one/static/description/assets/screenshots/v16-hero.gif b/fountain_widget_many2one/static/description/assets/screenshots/v16-hero.gif new file mode 100644 index 000000000..a4f14923d Binary files /dev/null and b/fountain_widget_many2one/static/description/assets/screenshots/v16-hero.gif differ diff --git a/fountain_widget_many2one/static/description/banner.png b/fountain_widget_many2one/static/description/banner.png new file mode 100644 index 000000000..fe556f77c Binary files /dev/null and b/fountain_widget_many2one/static/description/banner.png differ diff --git a/fountain_widget_many2one/static/description/icon.png b/fountain_widget_many2one/static/description/icon.png new file mode 100644 index 000000000..8e1edde2a Binary files /dev/null and b/fountain_widget_many2one/static/description/icon.png differ diff --git a/fountain_widget_many2one/static/description/index.html b/fountain_widget_many2one/static/description/index.html new file mode 100755 index 000000000..a96a2d955 --- /dev/null +++ b/fountain_widget_many2one/static/description/index.html @@ -0,0 +1,719 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Fountain Widget

+

+ This Widget is Used to Select the Many2one Field in Fountain + Manner.

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This is a widget for many2one fields having parent and child relation. By using this widget we can select + record in fountain manner. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community, Odoo.sh & + Enterprise Support. +
+
+ + Generates dynamic dropdown menus with hierarchical options. +
+
+ + Provides an interactive user interface for selecting options. +
+
+ + Supports saving selected data to the database. +
+
+ + Fetches data from the backend in real-time. +
+
+ + Organizes options in a hierarchical structure. +
+
+ + Supports parent-child relationships between dropdown options. +
+
+ +
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ The provided screenshot displays a standard Many2One field for + product category in Odoo. +

+ + +
+
+

+ Add 'widget="fountain_widget"' to the view of Many2One field, + you can do so either through the user interface (UI) or via + code. Here's how to achieve it through the UI, by + editing the form view. +

+ + +
+ +
+

+ After adding the widget to the Many2One field in Odoo, you will + have a new custom dropdown functionality to display hierarchical + data. +

+ + +
+ +
+

+ When you click on the field, the parent records will be + displayed first in the dropdown. +

+ + +
+ +
+

+ An arrow icon indicates records that have child records. + Clicking on that record will open a dropdown containing its + child records.

+ +
+ +
+

+ The hierarchical structure continues for records with child + records, with each click opening another dropdown for the child + records, maintaining the hierarchy.

+ +
+ +
+

+ In addition to clicking, the field's value also updates + according to the selected record. Finally, you can save the record with the selected values in the + Many2One field.

+ +
+ +
+

+ After saving, you will see the updated value in the Many2One + field. +

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

+ Related + 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

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/fountain_widget_many2one/static/src/css/fountain_widget_many2one.css b/fountain_widget_many2one/static/src/css/fountain_widget_many2one.css new file mode 100644 index 000000000..88a6f2dc6 --- /dev/null +++ b/fountain_widget_many2one/static/src/css/fountain_widget_many2one.css @@ -0,0 +1,11 @@ +.divMargin{ +margin-right: 11px; +border-right: 1px solid black; +padding-right: 10px; +} +.dropdown-item-text { + display: block; + padding: 3px 20px; + color: #495057; + position: relative; +} diff --git a/fountain_widget_many2one/static/src/css/fountain_widget_many2one.scss b/fountain_widget_many2one/static/src/css/fountain_widget_many2one.scss new file mode 100644 index 000000000..9bfb3c16e --- /dev/null +++ b/fountain_widget_many2one/static/src/css/fountain_widget_many2one.scss @@ -0,0 +1,8 @@ +.icon_style{ + &::after{ + content: "\f061"; + font-family: 'FontAwesome'; + position: absolute; + right: 0px; +} +} diff --git a/fountain_widget_many2one/static/src/js/fountain_widget_component.js b/fountain_widget_many2one/static/src/js/fountain_widget_component.js new file mode 100644 index 000000000..a1189a6a3 --- /dev/null +++ b/fountain_widget_many2one/static/src/js/fountain_widget_component.js @@ -0,0 +1,9 @@ +/** @odoo-module **/ +import { Dropdown } from "@web/core/dropdown/dropdown"; +//Extending the Dropdown and adding the inputData into the props +export class FountainDropdown extends Dropdown { } +FountainDropdown.template = "fountain.Dropdown" +FountainDropdown.props = { + ...Dropdown.props, + inputData: { type: Object, optional: true } +} diff --git a/fountain_widget_many2one/static/src/js/fountain_widget_many2one.js b/fountain_widget_many2one/static/src/js/fountain_widget_many2one.js new file mode 100644 index 000000000..106bf85cb --- /dev/null +++ b/fountain_widget_many2one/static/src/js/fountain_widget_many2one.js @@ -0,0 +1,67 @@ +/** @odoo-module **/ +import { Component, useState, useEffect, onWillStart } from "@odoo/owl"; +import { registry } from "@web/core/registry"; +import { standardFieldProps } from "@web/views/fields/standard_field_props"; +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { FountainDropdown } from "./fountain_widget_component" +import { useService } from '@web/core/utils/hooks'; + +export class FountainWidget extends Component { + //Extending component and creating a new widget + setup() { + this.orm = useService('orm'); + useEffect(() => { this.state.inputData = this.props.record.data[this.props.name] }, () => [this.props]) + this.state = useState({ + childMenu: {}, + inputData: this.props.record.data[this.props.name] + }); + onWillStart(async () => { + this.state.category = await this.orm.searchRead(this.props.record.fields[this.props.id].relation, []); + }); + this.index = 0 + } + // Function for returning the data to be inserted in the input + get inputData() { + return { + input: this.state.inputData[1] + } + } + // Function to get parent records + get parentMenu() { + return this.state.category.filter(item => !item.parent_id) + } + // Function to get child records + get childKeys() { + return Object.keys(this.state.childMenu) + } + // Click function of the options + onClickDropDown(parent_id, index = 0) { + if (this.index >= index) { + let childLength = this.childKeys.length + while (index < childLength) { + const keyIndex = this.childKeys[index] + delete this.state.childMenu[keyIndex] + childLength-- + } + } + let obj = this.state.category.filter(item => item.parent_id[0] === parent_id) + if (!this.state.childMenu.hasOwnProperty(parent_id) && obj.length > 0) { + this.state.childMenu[parent_id] = obj + this.index = index; + } + this.props.update([parent_id]) + return obj + } +} +FountainWidget.template = 'FountainWidgetField'; +FountainWidget.components = { + Dropdown, + DropdownItem, + FountainDropdown, +}; +FountainWidget.props = { + ...standardFieldProps, +}; +FountainWidget.supportedTypes = ["many2one"]; +registry.category("fields").add("fountain_widget", FountainWidget); diff --git a/fountain_widget_many2one/static/src/xml/fountain_widget_component.xml b/fountain_widget_many2one/static/src/xml/fountain_widget_component.xml new file mode 100644 index 000000000..26e6c617c --- /dev/null +++ b/fountain_widget_many2one/static/src/xml/fountain_widget_component.xml @@ -0,0 +1,38 @@ + + + + + + + diff --git a/fountain_widget_many2one/static/src/xml/fountain_widget_many2one.xml b/fountain_widget_many2one/static/src/xml/fountain_widget_many2one.xml new file mode 100644 index 000000000..235c9a290 --- /dev/null +++ b/fountain_widget_many2one/static/src/xml/fountain_widget_many2one.xml @@ -0,0 +1,41 @@ + + + + + +
+
+ + + + + +
+
+ + + + + + + +
+
+
+
+