diff --git a/product_management_app/README.rst b/product_management_app/README.rst new file mode 100644 index 000000000..d6f94c91d --- /dev/null +++ b/product_management_app/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Product Management +================== +Dashboard which displays top sales, purchases monthly movements and location categorization of Products. + +Configuration +============= +* No Additional configuration is needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, v3.0 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers : (V16) Neethu UM, + (V17) Kailas Krishna, + (V18) Aysha Shalin + 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/product_management_app/__init__.py b/product_management_app/__init__.py new file mode 100644 index 000000000..e34be7edf --- /dev/null +++ b/product_management_app/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC +# LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/product_management_app/__manifest__.py b/product_management_app/__manifest__.py new file mode 100644 index 000000000..bd591843d --- /dev/null +++ b/product_management_app/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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': 'Product Management', + 'version': '18.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Dashboard which displays top sales, purchases monthly + movements and location categorization of Products.""", + 'description': """This module module for each product, accompanied by + its dedicated dashboard. This dashboard should feature charts highlighting + the top-selling products, top-purchased products, and monthly product + movements. Additionally, include a section displaying products categorized + by location.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'license': 'LGPL-3', + 'depends': ['product', 'sale', 'purchase', 'stock'], + 'data': [ + 'views/product_views.xml', + 'views/product_dashboard.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.0/chart.umd.min.js', + 'product_management_app/static/src/css/dashboard_views.css', + 'product_management_app/static/src/js/product_dashboard.js', + 'product_management_app/static/src/xml/dashboard.xml', + ], + }, + 'images': [ + 'static/description/banner.png', + ], + 'installable': True, + 'auto_install': False, + 'application': True +} diff --git a/product_management_app/doc/RELEASE_NOTES.md b/product_management_app/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9c5fd7ab0 --- /dev/null +++ b/product_management_app/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 25.04.2025 +#### Version 18.0.1.0.0 +##### ADD +- Initial commit for Product Management diff --git a/product_management_app/models/__init__.py b/product_management_app/models/__init__.py new file mode 100644 index 000000000..d36df7a6f --- /dev/null +++ b/product_management_app/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC +# LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import product + diff --git a/product_management_app/models/product.py b/product_management_app/models/product.py new file mode 100644 index 000000000..c6e8248d3 --- /dev/null +++ b/product_management_app/models/product.py @@ -0,0 +1,225 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 . +# +############################################################################## +import calendar +from datetime import datetime +from collections import OrderedDict +from odoo import api, models + + +class ProductTemplate(models.Model): + """ The ProductTemplate model inherited to function for creating the + Template Dashboard values. """ + _inherit = 'product.template' + + @api.model + def get_data(self): + """ Return data to the tiles of dashboard """ + return { + 'product_templates': self.search_count([]), + 'product_variants': self.env['product.product'].search_count([]), + 'combo': self.search_count([('type', '=', 'combo')]), + 'goods': self.search_count([('type', '=', 'consu')]), + 'service': self.search_count([('type', '=', 'service')]), + 'category': self.env['product.category'].search_count([]), + 'price_list': self.env['product.pricelist'].search_count([]), + 'product_attribute': self.env['product.attribute'].search_count([]), + } + + @api.model + def get_top_sale_data(self): + """ Return the top sold products """ + query = ''' + select DISTINCT(product_template.name ->> 'en_US') as product_name, + sum(product_uom_qty) as total_quantity + from sale_order_line + inner join product_product + on product_product.id=sale_order_line.product_id + inner join product_template + on product_product.product_tmpl_id = product_template.id + where sale_order_line.company_id = ''' + str( + self.env.company.id) + ''' group by product_template.id + ORDER BY total_quantity DESC Limit 10 + ''' + self._cr.execute(query) + top_product = self._cr.dictfetchall() + total_quantity = [record.get('total_quantity') for record in top_product] + product_name = [record.get('product_name') for record in top_product] + final = [total_quantity, product_name] + return final + + @api.model + def get_top_purchase_data(self): + """ Returns top purchased products """ + query = (''' + select DISTINCT(product_template.name ->> 'en_US') as product_name, + sum(product_qty) as total_quantity + from purchase_order_line + inner join product_product + on product_product.id=purchase_order_line.product_id + inner join product_template + on product_product.product_tmpl_id = product_template.id + where purchase_order_line.company_id = ''' + str( + self.env.company.id) + ''' + group by product_template.id + ORDER BY total_quantity DESC Limit 10 ''') + self._cr.execute(query) + top_product = self._cr.dictfetchall() + final = [ + [record.get('total_quantity') for record in top_product], + [record.get('product_name') for record in top_product] + ] + return final + + @api.model + def get_product_location_analysis(self): + """ Returns the location and location id to the selection """ + categ_qry = """select id, complete_name from stock_location""" + self._cr.execute(categ_qry) + location = self._cr.dictfetchall() + location_id = [rec['id'] for rec in location] + location_name = [rec['complete_name'] for rec in location] + value1 = {'location_id': location_id, 'location_name': location_name} + return value1 + + @api.model + def get_products(self): + """ Returns the product and product name to the selection """ + data = self.env['product.template'].search([]) + product_id = [record['id'] for record in data] + product_name = [self.env['product.template'].search( + [('id', '=', record['id'])]).name for record in data] + value1 = {'product_id': product_id, 'product_name': product_name} + return value1 + + @api.model + def get_years(self): + """ To get the last 5 years """ + current_year = datetime.now().year + last_five_years = [current_year - year for year in range(5)] + return last_five_years + + @api.model + def get_prod_details(self, data, year): + """ Returns the monthly analysis of product movement """ + query = """ + select product_template.name as name,sum(stock_move_line.quantity), + stock_move_line.date as date_part + from stock_move_line + inner join product_product + on product_product.id = stock_move_line.product_id + inner join product_template + on product_product.product_tmpl_id = product_template.id + where stock_move_line.company_id = %s and product_template.id = %s + group by product_template.name, stock_move_line.date + """ % (self.env.company.id, data) + self._cr.execute(query) + product_moves = self._cr.dictfetchall() + product_move = [move for move in product_moves if + str(move['date_part'].year) == year] + month = [int(rec['date_part'].month) for rec in product_move] + for rec in product_move: + date_part = rec.get('date_part') + rec.update({ + 'count': rec['sum'], + 'dates': calendar.month_name[int(date_part.month)], + 'month': int(date_part.month) + }) + [product_move.append({ + 'count': 0, + 'dates': calendar.month_name[rec], + 'month': rec + }) for rec in range(1, 13) if rec not in month] + cr = sorted(product_move, key=lambda i: i['month']) + month_of_num = 0 + total_count = 0 + for rec in cr: + if month_of_num == rec['month']: + total_count += rec['count'] + if rec['count'] > 0: + rec.update({'count': total_count}) + else: + month_of_num = rec['month'] + total_count = rec['count'] + # OrderedDict to maintain insertion order + result = OrderedDict() + for item in cr: + # Check if month already exists + month = item['month'] + if month not in result or item['count'] > result[month]['count']: + result[month] = item + # Convert back to list + result = list(result.values()) + count = [rec['count'] for rec in result] + months = [rec['dates'] for rec in result] + return { + 'count': count, + 'dates': months + } + + @api.model + def product_move_by_category(self, args): + """ Rpc method of product moves by category. Returns category name and + quantity_done. """ + category_id = int(args) + company_id = self.env.company.id + query = (''' + select product_template.name,sum(stock_move_line.qty_done) + from stock_move_line + inner join product_product + on stock_move_line.product_id = product_product.id + inner join product_template + on product_product.product_tmpl_id = product_template.id + inner join product_category + on product_template.categ_id = product_category.id + where stock_move_line.company_id = %s and product_category.id = %s + group by product_template.name + ''' % (company_id, category_id)) + self._cr.execute(query) + product_move = self._cr.dictfetchall() + quantity_done = [record['sum'] for record in product_move] + name = [record['name'] for record in product_move] + value = { + 'name': name, + 'count': quantity_done, + } + return value + + @api.model + def get_product_qty_by_loc(self, args): + """ Returns product qty based on the location selected. """ + query = (''' + select sl.complete_name, pt.name as name, sq.quantity + from stock_quant sq + inner join stock_location sl on sq.location_id = sl.id + inner join product_product pp on sq.product_id = pp.id + inner join product_template pt on pp.product_tmpl_id = pt.id + where sq.company_id = '%s' and sl.id = '%s' + group by sl.complete_name,pt.name, sq.quantity + ''' % (self.env.company.id, int(args))) + self._cr.execute(query) + product_qty = self._cr.dictfetchall() + product = [rec['name'] for rec in product_qty] + quantity = [rec['quantity'] for rec in product_qty] + return { + 'products': product, + 'quantity': quantity, + } diff --git a/product_management_app/static/description/assets/cybro-icon.png b/product_management_app/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/product_management_app/static/description/assets/cybro-icon.png differ diff --git a/product_management_app/static/description/assets/cybro-odoo.png b/product_management_app/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/product_management_app/static/description/assets/cybro-odoo.png differ diff --git a/product_management_app/static/description/assets/h2.png b/product_management_app/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/product_management_app/static/description/assets/h2.png differ diff --git a/product_management_app/static/description/assets/icons/arrows-repeat.svg b/product_management_app/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/product_management_app/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-1.png b/product_management_app/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/product_management_app/static/description/assets/icons/banner-1.png differ diff --git a/product_management_app/static/description/assets/icons/banner-2.svg b/product_management_app/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-bg.png b/product_management_app/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/product_management_app/static/description/assets/icons/banner-bg.png differ diff --git a/product_management_app/static/description/assets/icons/banner-bg.svg b/product_management_app/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-call.svg b/product_management_app/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-mail.svg b/product_management_app/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-pattern.svg b/product_management_app/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/banner-promo.svg b/product_management_app/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/product_management_app/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/brand-pair.svg b/product_management_app/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/product_management_app/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/check.png b/product_management_app/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/product_management_app/static/description/assets/icons/check.png differ diff --git a/product_management_app/static/description/assets/icons/chevron.png b/product_management_app/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/product_management_app/static/description/assets/icons/chevron.png differ diff --git a/product_management_app/static/description/assets/icons/close-icon.svg b/product_management_app/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/product_management_app/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_management_app/static/description/assets/icons/cogs.png b/product_management_app/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_management_app/static/description/assets/icons/cogs.png differ diff --git a/product_management_app/static/description/assets/icons/collabarate-icon.svg b/product_management_app/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/product_management_app/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_management_app/static/description/assets/icons/consultation.png b/product_management_app/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_management_app/static/description/assets/icons/consultation.png differ diff --git a/product_management_app/static/description/assets/icons/cybro-logo.png b/product_management_app/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/product_management_app/static/description/assets/icons/cybro-logo.png differ diff --git a/product_management_app/static/description/assets/icons/down.svg b/product_management_app/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/product_management_app/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/product_management_app/static/description/assets/icons/ecom-black.png b/product_management_app/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_management_app/static/description/assets/icons/ecom-black.png differ diff --git a/product_management_app/static/description/assets/icons/education-black.png b/product_management_app/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_management_app/static/description/assets/icons/education-black.png differ diff --git a/product_management_app/static/description/assets/icons/faq.png b/product_management_app/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/product_management_app/static/description/assets/icons/faq.png differ diff --git a/product_management_app/static/description/assets/icons/feature-icon.svg b/product_management_app/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/product_management_app/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/feature.png b/product_management_app/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/product_management_app/static/description/assets/icons/feature.png differ diff --git a/product_management_app/static/description/assets/icons/gear.svg b/product_management_app/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/product_management_app/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/hero.gif b/product_management_app/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/product_management_app/static/description/assets/icons/hero.gif differ diff --git a/product_management_app/static/description/assets/icons/hire-odoo.svg b/product_management_app/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/product_management_app/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/hotel-black.png b/product_management_app/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_management_app/static/description/assets/icons/hotel-black.png differ diff --git a/product_management_app/static/description/assets/icons/license.png b/product_management_app/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_management_app/static/description/assets/icons/license.png differ diff --git a/product_management_app/static/description/assets/icons/life-ring-icon.svg b/product_management_app/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/product_management_app/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/lifebuoy.png b/product_management_app/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_management_app/static/description/assets/icons/lifebuoy.png differ diff --git a/product_management_app/static/description/assets/icons/mail.svg b/product_management_app/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/product_management_app/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_management_app/static/description/assets/icons/manufacturing-black.png b/product_management_app/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_management_app/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_management_app/static/description/assets/icons/notes.png b/product_management_app/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/product_management_app/static/description/assets/icons/notes.png differ diff --git a/product_management_app/static/description/assets/icons/notification icon.svg b/product_management_app/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/product_management_app/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/odoo-consultancy.svg b/product_management_app/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/product_management_app/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/product_management_app/static/description/assets/icons/odoo-licencing.svg b/product_management_app/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/product_management_app/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_management_app/static/description/assets/icons/odoo-logo.png b/product_management_app/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/product_management_app/static/description/assets/icons/odoo-logo.png differ diff --git a/product_management_app/static/description/assets/icons/patter.svg b/product_management_app/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/product_management_app/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/pattern1.png b/product_management_app/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/product_management_app/static/description/assets/icons/pattern1.png differ diff --git a/product_management_app/static/description/assets/icons/pos-black.png b/product_management_app/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_management_app/static/description/assets/icons/pos-black.png differ diff --git a/product_management_app/static/description/assets/icons/puzzle-piece-icon.svg b/product_management_app/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/product_management_app/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/puzzle.png b/product_management_app/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_management_app/static/description/assets/icons/puzzle.png differ diff --git a/product_management_app/static/description/assets/icons/replace-icon.svg b/product_management_app/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/product_management_app/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/restaurant-black.png b/product_management_app/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_management_app/static/description/assets/icons/restaurant-black.png differ diff --git a/product_management_app/static/description/assets/icons/screenshot-main.png b/product_management_app/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/product_management_app/static/description/assets/icons/screenshot-main.png differ diff --git a/product_management_app/static/description/assets/icons/screenshot.png b/product_management_app/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/product_management_app/static/description/assets/icons/screenshot.png differ diff --git a/product_management_app/static/description/assets/icons/service-black.png b/product_management_app/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_management_app/static/description/assets/icons/service-black.png differ diff --git a/product_management_app/static/description/assets/icons/skype-fill.svg b/product_management_app/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/product_management_app/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/skype.png b/product_management_app/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/product_management_app/static/description/assets/icons/skype.png differ diff --git a/product_management_app/static/description/assets/icons/skype.svg b/product_management_app/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/product_management_app/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_management_app/static/description/assets/icons/star-1.svg b/product_management_app/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/product_management_app/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/star-2.svg b/product_management_app/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/product_management_app/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/support.png b/product_management_app/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/product_management_app/static/description/assets/icons/support.png differ diff --git a/product_management_app/static/description/assets/icons/test-1 - Copy.png b/product_management_app/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/product_management_app/static/description/assets/icons/test-1 - Copy.png differ diff --git a/product_management_app/static/description/assets/icons/test-1.png b/product_management_app/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/product_management_app/static/description/assets/icons/test-1.png differ diff --git a/product_management_app/static/description/assets/icons/test-2.png b/product_management_app/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/product_management_app/static/description/assets/icons/test-2.png differ diff --git a/product_management_app/static/description/assets/icons/trading-black.png b/product_management_app/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_management_app/static/description/assets/icons/trading-black.png differ diff --git a/product_management_app/static/description/assets/icons/training.png b/product_management_app/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_management_app/static/description/assets/icons/training.png differ diff --git a/product_management_app/static/description/assets/icons/translate.svg b/product_management_app/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/product_management_app/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/update.png b/product_management_app/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_management_app/static/description/assets/icons/update.png differ diff --git a/product_management_app/static/description/assets/icons/user.png b/product_management_app/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_management_app/static/description/assets/icons/user.png differ diff --git a/product_management_app/static/description/assets/icons/video.png b/product_management_app/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/product_management_app/static/description/assets/icons/video.png differ diff --git a/product_management_app/static/description/assets/icons/whatsapp.png b/product_management_app/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/product_management_app/static/description/assets/icons/whatsapp.png differ diff --git a/product_management_app/static/description/assets/icons/wrench-icon.svg b/product_management_app/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/product_management_app/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_management_app/static/description/assets/icons/wrench.png b/product_management_app/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_management_app/static/description/assets/icons/wrench.png differ diff --git a/product_management_app/static/description/assets/modules/1.gif b/product_management_app/static/description/assets/modules/1.gif new file mode 100644 index 000000000..dc180280d Binary files /dev/null and b/product_management_app/static/description/assets/modules/1.gif differ diff --git a/product_management_app/static/description/assets/modules/2.png b/product_management_app/static/description/assets/modules/2.png new file mode 100644 index 000000000..ecea68d98 Binary files /dev/null and b/product_management_app/static/description/assets/modules/2.png differ diff --git a/product_management_app/static/description/assets/modules/3.png b/product_management_app/static/description/assets/modules/3.png new file mode 100644 index 000000000..e0b09a5a0 Binary files /dev/null and b/product_management_app/static/description/assets/modules/3.png differ diff --git a/product_management_app/static/description/assets/modules/4.jpg b/product_management_app/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..4bd9278e3 Binary files /dev/null and b/product_management_app/static/description/assets/modules/4.jpg differ diff --git a/product_management_app/static/description/assets/modules/5.jpg b/product_management_app/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..31a56b08c Binary files /dev/null and b/product_management_app/static/description/assets/modules/5.jpg differ diff --git a/product_management_app/static/description/assets/modules/6.png b/product_management_app/static/description/assets/modules/6.png new file mode 100644 index 000000000..17089cab4 Binary files /dev/null and b/product_management_app/static/description/assets/modules/6.png differ diff --git a/product_management_app/static/description/assets/screenshots/1.png b/product_management_app/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6f7a076c2 Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/1.png differ diff --git a/product_management_app/static/description/assets/screenshots/2.png b/product_management_app/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..cb78de0cf Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/2.png differ diff --git a/product_management_app/static/description/assets/screenshots/3.png b/product_management_app/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..3db57a5e8 Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/3.png differ diff --git a/product_management_app/static/description/assets/screenshots/4.png b/product_management_app/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8a11b176d Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/4.png differ diff --git a/product_management_app/static/description/assets/screenshots/hero.gif b/product_management_app/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d6fe3dfbc Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/hero.gif differ diff --git a/product_management_app/static/description/assets/y18.jpg b/product_management_app/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/product_management_app/static/description/assets/y18.jpg differ diff --git a/product_management_app/static/description/banner.png b/product_management_app/static/description/banner.png new file mode 100644 index 000000000..223e7df08 Binary files /dev/null and b/product_management_app/static/description/banner.png differ diff --git a/product_management_app/static/description/icon.png b/product_management_app/static/description/icon.png new file mode 100644 index 000000000..aaf2b6dd2 Binary files /dev/null and b/product_management_app/static/description/icon.png differ diff --git a/product_management_app/static/description/index.html b/product_management_app/static/description/index.html new file mode 100644 index 000000000..7aa216602 --- /dev/null +++ b/product_management_app/static/description/index.html @@ -0,0 +1,1088 @@ + + + + + + Product Management + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ Manage the Products Independently. +

+

Product Management +

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

Key + Highlights

+
+
+
+
+ +
+
+ Product Dashboard +
+
+
+
+
+
+ +
+
+ Separate Product Module +
+
+
+
+
+
+ +
+
+ Product By Location +
+
+
+
+
+
+ +
+
+ Product Movements In Month +
+
+
+
+
+ +
+
+
+ Product Management +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ New App + + Product Management +

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

+ Overview of + + Product Module +

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

+ Product Moves + Monthly Analysis +

+
+
+

+ Products moved are plot against each month. +

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

+ Product by + + Location +

+
+
+

+ Based on the selected location, the product + and quantity is displayed in the bar graph. +

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

+ Product as separate Module.

+
+
+
+
+
+
+
+ +
+

+ Manage Products, Product Variants, Price list, Product Stock and its movements.

+
+
+
+
+
+
+
+ +
+

+ Product Dashboard.

+
+
+
+
+
+
+
+ +
+

+ Graphs to show Top Sold/Purchased products.

+
+
+
+
+
+
+
+ +
+

+ Graphs to show products based on the location.

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

+ While configuring a + backup, selecting + the Zip option will + include the + filestore in the + backup, while + choosing the Dump + option will create a + backup without the + filestore. +

+
+
+ +
+ +
+

+ Enable the "Remove + Old Backups" option + in the backup + creation view to + automatically delete + previous backups + based on the number + of days specified. +

+
+
+ +
+ +
+

+ Enable the "Notify + User" option and + specify a contact to + receive an email + containing a + detailed report with + the failure reason + and backup details. + This option will + also send an email + upon successful + backup. +

+
+
+ +
+ +
+

+ Select the backup + destination as local + storage and specify + a backup path to a + location on the + system to create + backups on your own + system. +

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

+ Latest Release 18.0.1.0.0 +

+ + 6th November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/product_management_app/static/src/css/dashboard_views.css b/product_management_app/static/src/css/dashboard_views.css new file mode 100644 index 000000000..891182652 --- /dev/null +++ b/product_management_app/static/src/css/dashboard_views.css @@ -0,0 +1,320 @@ +.oh_dashboards{ + padding-top :15px; + background-color: #f8faff !important; +} + +.oh-card h4 { + font-size: 1.1rem; +} + +/* Widget One +---------------------------*/ +.stat-content { + display: inline-block; + width: 66%; +} +.stat-icon{ + display: inline-block; +} + +.stat-widget-one .stat-icon { + vertical-align: top; + margin: auto; + width: 100%; + color: #01c490; +} + +.stat-widget-one .stat-icon i { + font-size: 30px; + font-weight: 900; + display: inline-block; + color: #01c490;} + +.stat-widget-one .stat-text { + font-size: 14px; + color: #868e96; + font-weight: bold; +} + +.stat-widget-one .stat-digit { + font-size: 24px; + color: #02448b; } + +.stat-count { + font-size: 20px; + text-align: center; + color: #00438b;} + +.stat-title { + font-size: 17px; + text-align: center; + color: #00438b; } + +.mb-0{ + position: relative; +} +.mb-0 .dash-title { + font-size: 20px; + color: rgba(255, 255, 255, 0.81); +} + +.oh-card { + + padding-top: 0px; + padding: 0px; + margin-bottom: 1.5rem; + border-radius: 0px; + box-shadow: none; + background: none; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + +} +.oh-card:hover { + + transform: translateY(-2px) translateZ(0) !important; + box-shadow: 0 10px 10px 0 rgba(62, 57, 107, 0.12), 0 0 0 transparent !important; + +} +.oh-data { + margin-top: 2.5%; +} +.oh-data .stat-icon { + width: 30%; + height: 85px; + text-align: center; + background: #ff8762; + color: #fff; + width: 32%; + padding-top: 2%; + font-size: xxx-large; + +} +.oh-data .oh-card { + + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + +} +.stat-widget-one .stat-text { + font-size: 14px; + color: #ff8762; + margin-top: 2.3rem; + margin-left: 1rem; +} +.stat-widget-one .stat-digit { + font-size: 26px; + color:#993232; + margin-left: 1rem; + margin-top: -1px; + font-family: initial +} + +.stat-widget-one .stat-icon i { + + font-size: 25px; + font-weight: 900; + display: inline-block; + color: #fff; + +} +.stat-widget-one { + + background-color: white; + text-align: left; + +} +.stat-widget-one { + width: 100%; +} +.oh-data .stat-icon { + + width: 30%; + height: 85px; + text-align: center; + padding-top: 2%; + +} + +h4 .stat-count { + font-size: 17px; + text-align: center; + color: #000 !important; + margin-top: 0px; + width: 100%; + float: left; + margin: 0; +} + +.stat-head { + text-align: left !important; + font-weight: 300; + font-size: 15px; + margin-bottom: 25px; + margin-left: 24px; + width: 100%; +} +.oh-card-body { + display: flex; + justify-content: space-between; + align-items: center; +} + +.o_action_manager{ + overflow-y: scroll !important; + max-width:100%; + } + +.stat_count{ + margin-top: -89px; + margin-left: 35px; + font-size: 33px; +} + + +.stat-head { + text-align: left !important; + font-weight: 300; + font-size: 18px; + margin-bottom: 25px; + margin-left: 24px; + width: 100%; + margin-top: 57px; + color: black; +} + +.top_chart{ + height: fit-content; +} +.row.main-section { + margin-right: 0px; !important; +} + +.chart-container { + border-radius: 0.3rem; + padding: 1rem; + margin: 1rem auto; +} + +.chart-container.card-shadow { + height: 100%; +} + +.half_chart.chart-container.card-shadow { + height: 49%; +} +#container { + height: 400px; +} + + +/*table*/ +.graph_details_table{ +position: absolute; + top: 45px; + right: 15px; + + background-color: white; + border-collapse: collapse; + border: 1px solid #ddd; + +} + +.graph_details_table th{ +background-color:#67b7dc; +color: white; + width: 250px; + height: 30px; +} + +.graph_details_table td{ +border: 1px solid #ddd; +height: 20px; +} + +.graph_details_table tr:nth-child(even){background-color: #f2f2f2;} + +.graph_details_table tr:hover {background-color: #ddd;} + +.chart-container h2 { + font-weight: 700; + font-size: 1.690rem; +} + +.hr_notification { + background: #f6f7fa; + transition: transform 0.2s ease, box-shadow 0.2s ease; + will-change: transform, box-shadow; + box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62,57,107,0.06); + height: 316px; + overflow-y: auto; + margin-bottom: 15px; +} +.hr_notification .media { + border-bottom: 1px solid #e6e6e6; + padding-bottom: 6px; + margin-bottom: 10px; +} +hr_notification .text-color.display-6 { + margin: 0px 0 3px; + color: #2d2d2d; +} +.hr_notification p { + margin: 0 0 1px; + color: #666; + font-size: 10px; +} +.chart_head { + width: 850px; + margin-left: 21px; + font-size: 17px; + text-align: center; + padding: 12px 0; + color: #fff; + margin-bottom: 9px; +} +.hr_notification_head { + font-size: 17px; + text-align: center; + padding: 12px 0; + color: #fff; + font-weight: 300; + background: #5ebade; + margin-bottom: 9px; +} +@media (max-width: 767.98px) { + .oh-card{ + width: 100% !important; + } + .dashboard_main_section .form-control{ + width: 85% !important; + margin: 15px auto; + } + .sale_details{ + position: relative; + top: 0px !important; + right: 0px !important; + } + .selling_product_graph_view{ + margin-top: 5rem; + } + .hr_notification{ + min-width: 90% !important; + } +} +.hr_notification{ + min-width: 425.683px; + min-height: 316px; + max-width: 100%; +} +.media-body{ + + background: #466b8d; + float: left; + margin: 0; + width: 100% +} +.graph_canvas{ + height: 350px; +} diff --git a/product_management_app/static/src/js/product_dashboard.js b/product_management_app/static/src/js/product_dashboard.js new file mode 100644 index 000000000..f01fe49b5 --- /dev/null +++ b/product_management_app/static/src/js/product_dashboard.js @@ -0,0 +1,357 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { _t } from "@web/core/l10n/translation"; +import { Component, onWillStart, onMounted, useState, useRef } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +export class ProductDashboard extends Component{ + setup(){ + super.setup(...arguments); + this.orm = useService("orm"); + this.TopSaleChart = useRef("top_sale_chart") + this.TopPurchaseChart = useRef("top_purchase_chart") + this.ProductChart = useRef("product_graph") + this.ProductQtyChart = useRef("product_qty") + this.YearSelection = useRef("year-selection") + this.ProductSelection = useRef("product-selection") + this.ProductLocation = useRef("product-location") + this.state = useState({ + product_templates : [], + variants_count : [], + products_storable : [], + product_consumable: [], + product_service: [], + product_pricelist : [], + product_attribute:[], + location_chart: [], + move_chart: [], + }); + onWillStart(async () => { + await this.fetch_data(); + }); + onMounted(async ()=> { + await this.render_top_sold_product(); + await this.render_top_purchase_product(); + await this.render_year_chart (); + await this.render_monthly_chart (); + await this.onchange_prod_selection(); + await this.render_product_categ_analysis(); + await this.onchange_location_selection(); + }); + } + async fetch_data() { + // Fetch data to the tiles + var self = this + var result = await this.orm.call( 'product.template', "get_data",[]) + this.state.product_templates = result['product_templates'] + this.state.variants_count = result['product_variants'] + this.state.products_storable = result['combo'] + this.state.product_consumable = result['goods'] + this.state.product_service = result['service'] + this.state.product_categ = result['category'] + this.state.product_pricelist = result['price_list'] + this.state.product_attribute = result['product_attribute'] + } + async render_top_sold_product() { + // To view the top sale products in the chart + var self = this + var ctx = this.TopSaleChart.el; + const arrays = await this.orm.call( + 'product.template', "get_top_sale_data",[]) + var data = { + labels : arrays[1], + datasets: [{ + label: "", + data: arrays[0], + backgroundColor: [ + "#1E90FF", + "#95B9C7", + "#66CDAA", + "#FF7F50", + "#F67280", + "#810541", + "#7D0552", + "#D58A94", + "#B041FF" + ], + borderColor: [ + "#1E90FF", + "#95B9C7", + "#66CDAA", + "#FF7F50", + "#F67280", + "#810541", + "#7D0552", + "#D58A94", + "#B041FF" + ], + borderWidth: 1 + },] + }; + //options + var options = { + responsive: true, + title: false, + legend: { + display: true, + position: "right", + labels: { + fontColor: "#333", + fontSize: 16 + } + }, + scales: { + yAxes: [{ + gridLines: { + color: "rgba(0, 0, 0, 0)", + display: false, + }, + ticks: { + min: 0, + display: false, + } + }] + } + }; + //create Chart class object + var chart = new Chart(ctx, { + type: "pie", + data: data, + options: options + }); + } + async render_top_purchase_product() { + // To view the top purchase products in the chart + var self = this + var ctx = this.TopPurchaseChart.el; + const arrays = await this.orm.call( 'product.template', "get_top_purchase_data",[]) + var data = { + labels : arrays[1], + datasets: [{ + label: "", + data: arrays[0], + backgroundColor: [ + "#003f5c", + "#2f4b7c", + "#f95d6a", + "#665191", + "#d45087", + "#ff7c43", + "#ffa600", + "#a05195", + "#6d5c16" + ], + borderColor: [ + "#003f5c", + "#2f4b7c", + "#f95d6a", + "#665191", + "#d45087", + "#ff7c43", + "#ffa600", + "#a05195", + "#6d5c16" + ], + borderWidth: 1 + },] + }; + //options + var options = { + responsive: true, + title: false, + legend: { + display: true, + position: "right", + labels: { + fontColor: "#333", + fontSize: 16 + } + }, + scales: { + yAxes: [{ + gridLines: { + color: "rgba(0, 0, 0, 0)", + display: false, + }, + ticks: { + min: 0, + display: false, + } + }] + } + }; + //create Chart class object + var chart = new Chart(ctx, { + type: "doughnut", + data: data, + options: options + }); + } + async render_year_chart() { + // For adding the last 5 years in the selection field + var self = this + const data = await this.orm.call( 'product.template', "get_years",[]) + const select = this.YearSelection.el || this.YearSelection.getEl?.(); + if (select) { + data.forEach(year => { + const option = document.createElement("option"); + option.value = year; + option.textContent = year; + select.appendChild(option); // Use appendChild to append the option to the select + }); + } else { + console.error("Year selection element not found."); + } + } + async render_monthly_chart() { + // For listing the total products to filter the chart based on products + var self = this + const data = await this.orm.call( 'product.template', "get_products",[]) + const products = this.ProductSelection.el || this.ProductSelection.getEl?.(); + // Ensure the product selection element is valid + if (products) { + products.innerHTML = ''; + var k = 0; + // Loop through the product names and append options + Object.entries(data.product_name).forEach(([key, value]) => { + const option = document.createElement("option"); + option.value = data.product_id[k]; + option.textContent = value; + if (k == 0) { + option.selected = true; + } + products.appendChild(option); + k++; + }); + } else { + console.error("Product selection element not found or is not a