diff --git a/bom_comparison_report/README.rst b/bom_comparison_report/README.rst new file mode 100644 index 000000000..ef52a94d4 --- /dev/null +++ b/bom_comparison_report/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 + +BOM Comparison Report +===================== +This module helps to generate Bill of Material Comparison Report + +Configuration +============= +No additional configuration required + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V17) Mufeeda Shirin , + (V16) Mufeeda Shirin , +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: ``__ \ No newline at end of file diff --git a/bom_comparison_report/__init__.py b/bom_comparison_report/__init__.py new file mode 100644 index 000000000..ba73f9e7c --- /dev/null +++ b/bom_comparison_report/__init__.py @@ -0,0 +1,23 @@ +# -*- 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 reports +from . import wizards diff --git a/bom_comparison_report/__manifest__.py b/bom_comparison_report/__manifest__.py new file mode 100644 index 000000000..ed9d8eefc --- /dev/null +++ b/bom_comparison_report/__manifest__.py @@ -0,0 +1,52 @@ +# -*- 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': "BOM Comparison Report", + 'version': '16.0.1.0.0', + 'category': 'Manufacturing', + 'description': 'Get the Comparison report based on the cost or sales price ' + 'analysis for the selected Bill of materials', + 'summary': 'Comparison Report Of Bom Based on Analysis Method', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['mrp'], + 'data': [ + 'security/ir.model.access.csv', + 'views/mrp_bom_views.xml', + 'reports/bom_comparison_template.xml', + 'reports/ir_actions_report.xml', + 'wizards/bom_comparison_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'bom_comparison_report/static/src/js/bom_compare_button.js', + 'bom_comparison_report/static/src/xml/bom_compare_button_template.xml', + ] + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/bom_comparison_report/doc/RELEASE_NOTES.md b/bom_comparison_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9cf2be622 --- /dev/null +++ b/bom_comparison_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.03.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for BOM Comparison Report diff --git a/bom_comparison_report/reports/__init__.py b/bom_comparison_report/reports/__init__.py new file mode 100644 index 000000000..115842158 --- /dev/null +++ b/bom_comparison_report/reports/__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 bom_compare_report \ No newline at end of file diff --git a/bom_comparison_report/reports/bom_compare_report.py b/bom_comparison_report/reports/bom_compare_report.py new file mode 100644 index 000000000..8d86ac7cb --- /dev/null +++ b/bom_comparison_report/reports/bom_compare_report.py @@ -0,0 +1,64 @@ +# -*- 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 odoo import api, models + + +class BomCompareReport(models.AbstractModel): + """Abstract model for the pdf""" + _name = 'report.bom_comparison_report.bom_compare_report' + _description = 'Model Used To Print Bom Comparison Report' + + @api.model + def _get_report_values(self, docids, data=None): + """to get the report values""" + + analysis = data['form_data']['analysis'] + product_unit = data['form_data']['product_unit'] + bom_report = [] + for line in data['form_data']['bom_ids']: + bom = self.env['mrp.bom'].browse(line) + bom_total = 0 + for record in bom.bom_line_ids: + price = record.product_id.lst_price if analysis == 'sale_price' else record.product_id.standard_price + bom_total += (record.product_qty * price) + unit_total = (bom_total / bom.product_qty) if bom.product_qty else 0 + + bom_details = { + 'bom_name': bom.display_name, + 'products': len(bom.bom_line_ids.ids), + 'total': unit_total, + 'total_given': unit_total * product_unit + } + bom_report.append(bom_details) + better_option = bom_report[min(range(len(bom_report)), key=lambda i: bom_report[i]['total_given'])] + data = { + 'analysis': analysis, + 'unit': product_unit, + 'bom_report': bom_report, + 'better_option': better_option, + 'currency': self.env.user.company_id.currency_id.symbol, + } + return { + 'doc_ids': docids, + 'doc_model': 'bom.compare.wizard', + 'data': data, + } diff --git a/bom_comparison_report/reports/bom_comparison_template.xml b/bom_comparison_report/reports/bom_comparison_template.xml new file mode 100644 index 000000000..1404d090b --- /dev/null +++ b/bom_comparison_report/reports/bom_comparison_template.xml @@ -0,0 +1,80 @@ + + + + + diff --git a/bom_comparison_report/reports/ir_actions_report.xml b/bom_comparison_report/reports/ir_actions_report.xml new file mode 100644 index 000000000..7e4e91e8f --- /dev/null +++ b/bom_comparison_report/reports/ir_actions_report.xml @@ -0,0 +1,13 @@ + + + + + Bom Comparison Report + bom.comparison + qweb-pdf + bom_comparison_report.bom_compare_report + bom_comparison_report.bom_compare_report + + report + + diff --git a/bom_comparison_report/security/ir.model.access.csv b/bom_comparison_report/security/ir.model.access.csv new file mode 100644 index 000000000..3c402d94d --- /dev/null +++ b/bom_comparison_report/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_bom_comparison,access.bom.comparison,model_bom_comparison,base.group_user,1,1,1,1 + diff --git a/bom_comparison_report/static/description/assets/icons/check.png b/bom_comparison_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/check.png differ diff --git a/bom_comparison_report/static/description/assets/icons/chevron.png b/bom_comparison_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/chevron.png differ diff --git a/bom_comparison_report/static/description/assets/icons/cogs.png b/bom_comparison_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/cogs.png differ diff --git a/bom_comparison_report/static/description/assets/icons/consultation.png b/bom_comparison_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/consultation.png differ diff --git a/bom_comparison_report/static/description/assets/icons/ecom-black.png b/bom_comparison_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/ecom-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/education-black.png b/bom_comparison_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/education-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/hotel-black.png b/bom_comparison_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/hotel-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/license.png b/bom_comparison_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/license.png differ diff --git a/bom_comparison_report/static/description/assets/icons/lifebuoy.png b/bom_comparison_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/lifebuoy.png differ diff --git a/bom_comparison_report/static/description/assets/icons/manufacturing-black.png b/bom_comparison_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/pos-black.png b/bom_comparison_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/pos-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/puzzle.png b/bom_comparison_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/puzzle.png differ diff --git a/bom_comparison_report/static/description/assets/icons/restaurant-black.png b/bom_comparison_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/restaurant-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/service-black.png b/bom_comparison_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/service-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/trading-black.png b/bom_comparison_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/trading-black.png differ diff --git a/bom_comparison_report/static/description/assets/icons/training.png b/bom_comparison_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/training.png differ diff --git a/bom_comparison_report/static/description/assets/icons/update.png b/bom_comparison_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/update.png differ diff --git a/bom_comparison_report/static/description/assets/icons/user.png b/bom_comparison_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/user.png differ diff --git a/bom_comparison_report/static/description/assets/icons/wrench.png b/bom_comparison_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/bom_comparison_report/static/description/assets/icons/wrench.png differ diff --git a/bom_comparison_report/static/description/assets/misc/categories.png b/bom_comparison_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/categories.png differ diff --git a/bom_comparison_report/static/description/assets/misc/check-box.png b/bom_comparison_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/check-box.png differ diff --git a/bom_comparison_report/static/description/assets/misc/compass.png b/bom_comparison_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/compass.png differ diff --git a/bom_comparison_report/static/description/assets/misc/corporate.png b/bom_comparison_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/corporate.png differ diff --git a/bom_comparison_report/static/description/assets/misc/customer-support.png b/bom_comparison_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/customer-support.png differ diff --git a/bom_comparison_report/static/description/assets/misc/cybrosys-logo.png b/bom_comparison_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/bom_comparison_report/static/description/assets/misc/features.png b/bom_comparison_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/features.png differ diff --git a/bom_comparison_report/static/description/assets/misc/logo.png b/bom_comparison_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/logo.png differ diff --git a/bom_comparison_report/static/description/assets/misc/pictures.png b/bom_comparison_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/pictures.png differ diff --git a/bom_comparison_report/static/description/assets/misc/pie-chart.png b/bom_comparison_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/pie-chart.png differ diff --git a/bom_comparison_report/static/description/assets/misc/right-arrow.png b/bom_comparison_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/right-arrow.png differ diff --git a/bom_comparison_report/static/description/assets/misc/star.png b/bom_comparison_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/star.png differ diff --git a/bom_comparison_report/static/description/assets/misc/support.png b/bom_comparison_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/support.png differ diff --git a/bom_comparison_report/static/description/assets/misc/whatsapp.png b/bom_comparison_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/bom_comparison_report/static/description/assets/misc/whatsapp.png differ diff --git a/bom_comparison_report/static/description/assets/modules/1.png b/bom_comparison_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..489f44e86 Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/1.png differ diff --git a/bom_comparison_report/static/description/assets/modules/2.png b/bom_comparison_report/static/description/assets/modules/2.png new file mode 100644 index 000000000..4f9e87f6e Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/2.png differ diff --git a/bom_comparison_report/static/description/assets/modules/3.png b/bom_comparison_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..e571015b1 Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/3.png differ diff --git a/bom_comparison_report/static/description/assets/modules/4.png b/bom_comparison_report/static/description/assets/modules/4.png new file mode 100644 index 000000000..624ef69b7 Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/4.png differ diff --git a/bom_comparison_report/static/description/assets/modules/5.gif b/bom_comparison_report/static/description/assets/modules/5.gif new file mode 100644 index 000000000..8f40aab85 Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/5.gif differ diff --git a/bom_comparison_report/static/description/assets/modules/6.png b/bom_comparison_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..31ed46762 Binary files /dev/null and b/bom_comparison_report/static/description/assets/modules/6.png differ diff --git a/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-1.png b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-1.png new file mode 100644 index 000000000..f0573df16 Binary files /dev/null and b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-1.png differ diff --git a/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-2.png b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-2.png new file mode 100644 index 000000000..d4cceca07 Binary files /dev/null and b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-2.png differ diff --git a/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-3.png b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-3.png new file mode 100644 index 000000000..99bb74e90 Binary files /dev/null and b/bom_comparison_report/static/description/assets/screenshots/bom_comparison_report-3.png differ diff --git a/bom_comparison_report/static/description/assets/screenshots/hero.gif b/bom_comparison_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..7e0932a68 Binary files /dev/null and b/bom_comparison_report/static/description/assets/screenshots/hero.gif differ diff --git a/bom_comparison_report/static/description/banner.png b/bom_comparison_report/static/description/banner.png new file mode 100644 index 000000000..b711aad04 Binary files /dev/null and b/bom_comparison_report/static/description/banner.png differ diff --git a/bom_comparison_report/static/description/icon.png b/bom_comparison_report/static/description/icon.png new file mode 100644 index 000000000..f65a88524 Binary files /dev/null and b/bom_comparison_report/static/description/icon.png differ diff --git a/bom_comparison_report/static/description/index.html b/bom_comparison_report/static/description/index.html new file mode 100644 index 000000000..e302320b5 --- /dev/null +++ b/bom_comparison_report/static/description/index.html @@ -0,0 +1,539 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

BOM Comparison Report +

+

Generating Bill Of Material Comparison Report

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module helps to generate Bill of material comparison reports,and highlights the profitable Bill of material. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Available in Odoo 16.0 + Community and Enterprise +
+
+ + Compare More BOM at once +
+
+ + Highlights The Profitable BOM +
+ +
+ +
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Compare Button In BOM +

+

Go to Products -> Bill Of materials -> We can See The Compare button in Tree View +

+ +
+ +
+

BOM Comparison Wizard +

+

By clicking Compare button , We can set the Bill of materials in the wizard, Can set the Product Count ,Choose Analysis Method

+ +
+ +
+

Pdf Generated +

+

By Clicking Comparison Report Button , It will Generate pdf +

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

Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/bom_comparison_report/static/src/js/bom_compare_button.js b/bom_comparison_report/static/src/js/bom_compare_button.js new file mode 100644 index 000000000..8d538554c --- /dev/null +++ b/bom_comparison_report/static/src/js/bom_compare_button.js @@ -0,0 +1,25 @@ +/** @odoo-module */ +import { ListController } from "@web/views/list/list_controller"; +import { registry } from '@web/core/registry'; +import { listView } from '@web/views/list/list_view'; +export class BomList extends ListController { + setup() { + super.setup(); + } + ShowWizard() { + this.actionService.doAction({ + type: 'ir.actions.act_window', + res_model: 'bom.comparison', + name:'Open Wizard', + view_mode: 'form', + view_type: 'form', + views: [[false, 'form']], + target: 'new', + }); + } +} +registry.category("views").add("compare_button_tree", { + ...listView, + Controller: BomList, + buttonTemplate: "bom_comparison_report.ListView.Buttons", +}); \ No newline at end of file diff --git a/bom_comparison_report/static/src/xml/bom_compare_button_template.xml b/bom_comparison_report/static/src/xml/bom_compare_button_template.xml new file mode 100644 index 000000000..7714c2cd7 --- /dev/null +++ b/bom_comparison_report/static/src/xml/bom_compare_button_template.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/bom_comparison_report/views/mrp_bom_views.xml b/bom_comparison_report/views/mrp_bom_views.xml new file mode 100644 index 000000000..49f02be91 --- /dev/null +++ b/bom_comparison_report/views/mrp_bom_views.xml @@ -0,0 +1,14 @@ + + + + + mrp.bom.view.tree.inherit.bom.comparison.report + mrp.bom + + + + compare_button_tree + + + + diff --git a/bom_comparison_report/wizards/__init__.py b/bom_comparison_report/wizards/__init__.py new file mode 100644 index 000000000..344d878ba --- /dev/null +++ b/bom_comparison_report/wizards/__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 bom_comparison diff --git a/bom_comparison_report/wizards/bom_comparison.py b/bom_comparison_report/wizards/bom_comparison.py new file mode 100644 index 000000000..1fec23f7c --- /dev/null +++ b/bom_comparison_report/wizards/bom_comparison.py @@ -0,0 +1,66 @@ +# -*- 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 odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class BomComparison(models.TransientModel): + """Model Used for the BOM comparison report Wizard""" + _name = 'bom.comparison' + _description = "Wizard for comparing boms " + + product_tmpl_id = fields.Many2one('product.template', string='Product', help='Choose the product') + all_bom_ids = fields.Many2many('mrp.bom', compute='_compute_all_bom_ids', + help='Used to get all the bom related to selected product') + bom_ids = fields.Many2many('mrp.bom', domain="[('id','in',all_bom_ids)]", required=True, help='Choose the BOMs', + string='Bill of Materials') + product_unit = fields.Integer(string='Number of Products to Produce', default=1, + help='Set the number of products to produce') + analysis = fields.Selection(selection=[('cost', 'Cost'), ('sale_price', 'Sales Price')], string='Analysis Method', + required=True, help='Choose the Analysis Method') + + @api.depends('product_tmpl_id') + def _compute_all_bom_ids(self): + """Compute function to Get all bom with the selected product""" + for record in self: + record.all_bom_ids = self.env['mrp.bom'].search( + [('product_tmpl_id', '=', record.product_tmpl_id.id)]).ids + + def action_comparison_report(self): + """Action for the Report Generation""" + data = { + 'form_data': self.read()[0], + } + return self.env.ref('bom_comparison_report.bom_comparison_report_action').report_action(None, data=data) + + @api.constrains('bom_ids') + def _check_bom_ids(self): + """Constraints if No Boms to Compare""" + if len(self.bom_ids) <= 1: + raise ValidationError('The Comparison of BOMs Needs Minimum of two BOMs') + + @api.onchange('product_tmpl_id') + def _onchange_product_tmpl_id(self): + """Clear the bom ids when the product changes""" + self.update({ + 'bom_ids': [(fields.Command.clear())] + }) diff --git a/bom_comparison_report/wizards/bom_comparison_views.xml b/bom_comparison_report/wizards/bom_comparison_views.xml new file mode 100644 index 000000000..1c56d62cc --- /dev/null +++ b/bom_comparison_report/wizards/bom_comparison_views.xml @@ -0,0 +1,31 @@ + + + + + bom.comparison.action + bom.comparison + form + new + + + + bom.comparison.view.form + bom.comparison + +
+ + + + + + + + +
+
+
+
\ No newline at end of file