diff --git a/product_management_app/README.rst b/product_management_app/README.rst new file mode 100644 index 000000000..e1282a8ae --- /dev/null +++ b/product_management_app/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Product Management +================== +* Product Management module for Odoo 17. + +Configuration +============= +* No Additional configuration is needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/17.0/legal/licenses.html) + + +Credits +------- +* Developer : (V16) Neethu UM, + (V17) Kailas Krishna + 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..097bdb395 --- /dev/null +++ b/product_management_app/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/product_management_app/__manifest__.py b/product_management_app/__manifest__.py new file mode 100644 index 000000000..e080df802 --- /dev/null +++ b/product_management_app/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Product Management', + 'version': '17.0.1.0.0', + 'summary': "Build product modules with dashboards for top sales, purchases," + "monthly movements, and location categorization.", + 'description': """Create a separate 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.""", + 'category': 'Extra Tools', + '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.jpg', + ], + '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..34b3afc52 --- /dev/null +++ b/product_management_app/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.01.2024 +#### Version 17.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..cdf832108 --- /dev/null +++ b/product_management_app/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import product diff --git a/product_management_app/models/product.py b/product_management_app/models/product.py new file mode 100644 index 000000000..9f2e54d5e --- /dev/null +++ b/product_management_app/models/product.py @@ -0,0 +1,218 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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): + """Returns data to the tiles of dashboard""" + return { + 'product_templates': self.search_count([]), + 'product_variants': self.env['product.product'].search_count([]), + 'storable': self.search_count([('detailed_type', '=', 'product')]), + 'consumable': self.search_count([('detailed_type', '=', 'consu')]), + 'service': self.search_count([('detailed_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 sale""" + 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 purchase data""" + 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, 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 = [] + location_name = [] + for record in location: + location_id.append(record.get('id')) + location_name.append(record.get('complete_name')) + value1 = {'location_id': location_id, 'location_name': location_name} + return value1 + + @api.model + def get_products(self): + """Returns the product, product name to the selection""" + data = self.env['product.template'].search([]) + product_id = [] + product_name = [] + for record in data: + product_id.append(record.id) + product_name.append(self.env['product.template'].search([('id', '=', record.id)]).name) + value1 = {'product_id': product_id, 'product_name': product_name} + return value1 + + @api.model + def get_years(self): + """To get last 5 years from the current year""" + 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 = [] + for move in product_moves: + if str(move['date_part'].year) == year: + product_move.append(move) + month = [] + for rec in product_move: + date_part = rec.get('date_part') + month.append(int(date_part.month)) + rec.update({ + 'count': rec['sum'], + 'dates': calendar.month_name[int(date_part.month)], + 'month': int(date_part.month) + }) + for rec in range(1, 13): + if rec not in month: + product_move.append({ + 'count': 0, + 'dates': calendar.month_name[rec], + 'month': rec + }) + count = [] + months = [] + 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 + if item['month'] not in result: + result[item['month']] = item + else: + # Update if count is higher + if item['count'] > result[item['month']]['count']: + result[item['month']] = item + # Convert back to list + result = list(result.values()) + for rec in result: + count.append(rec['count']) + months.append(rec['dates']) + 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 = [] + name = [] + for record in product_move: + quantity_done.append(record.get('sum')) + name.append(record.get('name')) + 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/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/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/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/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/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/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/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/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.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/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/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/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/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/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/misc/Cybrosys R.png b/product_management_app/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/product_management_app/static/description/assets/misc/Cybrosys R.png differ diff --git a/product_management_app/static/description/assets/misc/categories.png b/product_management_app/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/product_management_app/static/description/assets/misc/categories.png differ diff --git a/product_management_app/static/description/assets/misc/check-box.png b/product_management_app/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/product_management_app/static/description/assets/misc/check-box.png differ diff --git a/product_management_app/static/description/assets/misc/compass.png b/product_management_app/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/product_management_app/static/description/assets/misc/compass.png differ diff --git a/product_management_app/static/description/assets/misc/corporate.png b/product_management_app/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/product_management_app/static/description/assets/misc/corporate.png differ diff --git a/product_management_app/static/description/assets/misc/customer-support.png b/product_management_app/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/product_management_app/static/description/assets/misc/customer-support.png differ diff --git a/product_management_app/static/description/assets/misc/cybrosys-logo.png b/product_management_app/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/product_management_app/static/description/assets/misc/cybrosys-logo.png differ diff --git a/product_management_app/static/description/assets/misc/email.svg b/product_management_app/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/product_management_app/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/misc/features.png b/product_management_app/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/product_management_app/static/description/assets/misc/features.png differ diff --git a/product_management_app/static/description/assets/misc/logo.png b/product_management_app/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/product_management_app/static/description/assets/misc/logo.png differ diff --git a/product_management_app/static/description/assets/misc/phone.svg b/product_management_app/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/product_management_app/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_management_app/static/description/assets/misc/pictures.png b/product_management_app/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/product_management_app/static/description/assets/misc/pictures.png differ diff --git a/product_management_app/static/description/assets/misc/pie-chart.png b/product_management_app/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/product_management_app/static/description/assets/misc/pie-chart.png differ diff --git a/product_management_app/static/description/assets/misc/right-arrow.png b/product_management_app/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/product_management_app/static/description/assets/misc/right-arrow.png differ diff --git a/product_management_app/static/description/assets/misc/star (1) 2.svg b/product_management_app/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/product_management_app/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/misc/star.png b/product_management_app/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/product_management_app/static/description/assets/misc/star.png differ diff --git a/product_management_app/static/description/assets/misc/support (1) 1.svg b/product_management_app/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/product_management_app/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/misc/support-email.svg b/product_management_app/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/product_management_app/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/product_management_app/static/description/assets/misc/support.png b/product_management_app/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/product_management_app/static/description/assets/misc/support.png differ diff --git a/product_management_app/static/description/assets/misc/tick-mark.svg b/product_management_app/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/product_management_app/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/misc/whatsapp 1.svg b/product_management_app/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/product_management_app/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_management_app/static/description/assets/misc/whatsapp.png b/product_management_app/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/product_management_app/static/description/assets/misc/whatsapp.png differ diff --git a/product_management_app/static/description/assets/misc/whatsapp.svg b/product_management_app/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/product_management_app/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_management_app/static/description/assets/modules/1.jpg b/product_management_app/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/product_management_app/static/description/assets/modules/1.jpg differ diff --git a/product_management_app/static/description/assets/modules/2.jpg b/product_management_app/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..677f72279 Binary files /dev/null and b/product_management_app/static/description/assets/modules/2.jpg 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..a5299d338 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.png b/product_management_app/static/description/assets/modules/4.png new file mode 100644 index 000000000..3bedf7981 Binary files /dev/null and b/product_management_app/static/description/assets/modules/4.png 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..5ae24843e 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..0dea4f332 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..d41bc9d97 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..39381d295 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..52b0b7b9f 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..730c2fa4d 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/5.png b/product_management_app/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..aa1cf5795 Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/5.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..7e794d421 Binary files /dev/null and b/product_management_app/static/description/assets/screenshots/hero.gif differ diff --git a/product_management_app/static/description/banner.jpg b/product_management_app/static/description/banner.jpg new file mode 100644 index 000000000..80fce68b0 Binary files /dev/null and b/product_management_app/static/description/banner.jpg 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..b1af60603 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..432d0149f --- /dev/null +++ b/product_management_app/static/description/index.html @@ -0,0 +1,771 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Product Management

+

+ Manage The Products Independently +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Product Dashboard

+
+
+
+
+
+
+ +
+
+

+ Product Seperate Module

+
+
+
+
+
+
+ +
+
+

+ Product By Location

+
+
+
+
+
+
+ +
+
+

+ Product Movements In Month

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ New App Product Managment
+
+
+
+
+
+
+ +
+
+
+ Product Module over view
+
+
+
+
+
+
+ +
+
+
+ Product's Dashboard
+

+ Dashboard for quick overview of the products. +

+
+
+
+
+
+
+ +
+
+
+ Products' monthly analysis
+

+ Product moved are plot against each month. +

+
+
+
+
+
+
+ +
+
+
+ Products by location +
+

+ Based on the selected location the product, + it's quantity can be view in the bar graph. +

+
+
+
+
+
+
+
    +
  • + Product as seperate Module. +
  • +
  • + + Manage product, product variants, price list, product stock, its movements. + +
  • +
  • + Dashboard to show the product's contents in general +
  • +
  • + Graphs to show product movements in each month. +
  • +
  • + + Graphs to show tops sold/purchased products. + +
  • +
  • + Graphs to show product based on the location. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:24th January 2024 +
+

+ Initial Commit for Product Managment.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/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..497acb9cc --- /dev/null +++ b/product_management_app/static/src/css/dashboard_views.css @@ -0,0 +1,321 @@ +.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% +} +.canvas{ + height: 500px; + width: 150px; +} 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..04cced360 --- /dev/null +++ b/product_management_app/static/src/js/product_dashboard.js @@ -0,0 +1,318 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { _t } from "@web/core/l10n/translation"; +import { Component } from "@odoo/owl"; +import { 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.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() { + var self = this + // fetch data to the tiles + 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['storable'] + this.state.product_consumable = result['consumable'] + 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 filed + var self = this + const data = await this.orm.call( 'product.template', "get_years",[]) + for (var year in data) { + $('#year_selection').append('') + } + } + 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",[]) + var k = 0; + Object.entries(data.product_name).forEach(([key, value]) => { + if(k == 0){ + $('#prod_selection').append('') + k++; + }else{ + $('#prod_selection').append('') + k++; + } + }); + } + async onchange_prod_selection() { + /* The filter is based on changes in products, displaying monthly + product movements*/ + if (this.state.move_chart.length != 0) { + this.state.move_chart.forEach((item)=> { + item.destroy() + }); + } + var option = $("#prod_selection").val(); + var year = $("#year_selection").val(); + var ctx = this.ProductChart.el; + const result = await this.orm.call('product.template', "get_prod_details", [option, year]) + var name = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + var data = { + labels: name,//x axis + datasets: [{ + label: 'Purchase Order Total', // Name the series + data: result.count, // Specify the data values array + backgroundColor: '#0000ff', + borderColor: '#0000ff', + barPercentage: 0.5, + barThickness: 6, + maxBarThickness: 8, + minBarLength: 0, + borderWidth: 1, // Specify bar border width + type: 'line', // Set this data to a line chart + fill: false + },] + } + var options = { + scales: { + y: { + beginAtZero: true + }, + }, + responsive: true, // Instruct chart js to respond nicely. + maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height + } + var chart = new Chart(ctx, { + type: "line", + data: data, + options: options + }); + this.state.move_chart.push(chart) + } + async render_product_categ_analysis() { + /* For listing the whole locations in the inventory in the*/ + var self = this + const data = await this.orm.call( 'product.template', "get_product_location_analysis",[]) + var k = 0; + Object.entries(data.location_name).forEach(([key, value]) => { + if(k == 0){ + $('#product_location_selection').append('') + k++; + }else{ + $('#product_location_selection').append('') + k++; + } + }); + } + async onchange_location_selection() { + /* The filter is based on changes in location, products based on the location */ + if (this.state.location_chart.length != 0) { + this.state.location_chart.forEach((item)=> { + item.destroy() + }); + } + var option = $("#product_location_selection" ).val(); + var ctx = this.ProductQtyChart.el; + const result = await this.orm.call( 'product.template', "get_product_qty_by_loc", [option]) + var product_list = [] + for (var product in result.products) { + product_list.push(result.products[product]['en_US']) + } + var data = { + labels: product_list, + datasets: [{ + label: 'Count', // Name the series + data: result.quantity, // Specify the data values array + backgroundColor: '#ac3973', + borderColor: '#ac3973', + barPercentage: 0.5, + barThickness: 6, + maxBarThickness: 8, + minBarLength: 0, + borderWidth: 1, // Specify bar border width + type: 'bar', // Set this data to a line chart + fill: false + }] + } + var options = { + scales: { + y: { + beginAtZero: true + }, + }, + responsive: true, // Instruct chart js to respond nicely. + maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height + } + var chart = new Chart(ctx, { + type: "bar", + data: data, + options: options + }); + this.state.location_chart.push(chart) + } +} +ProductDashboard.template = 'ProductDashboard' +registry.category("actions").add("product_dashboard_tag", ProductDashboard) diff --git a/product_management_app/static/src/xml/dashboard.xml b/product_management_app/static/src/xml/dashboard.xml new file mode 100644 index 000000000..e5e01c769 --- /dev/null +++ b/product_management_app/static/src/xml/dashboard.xml @@ -0,0 +1,233 @@ + + diff --git a/product_management_app/views/product_dashboard.xml b/product_management_app/views/product_dashboard.xml new file mode 100644 index 000000000..f83653f7d --- /dev/null +++ b/product_management_app/views/product_dashboard.xml @@ -0,0 +1,12 @@ + + + + Dashboard + product_dashboard_tag + + + diff --git a/product_management_app/views/product_views.xml b/product_management_app/views/product_views.xml new file mode 100644 index 000000000..74d5eb159 --- /dev/null +++ b/product_management_app/views/product_views.xml @@ -0,0 +1,23 @@ + + + + + + + + + + +