diff --git a/product_profit_report/README.rst b/product_profit_report/README.rst new file mode 100644 index 000000000..c1aaef070 --- /dev/null +++ b/product_profit_report/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Product Profit Report +===================== +This module is used to print the product wise profit report. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V12) Mohamed Muzammil VP, 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_profit_report/__init__.py b/product_profit_report/__init__.py new file mode 100644 index 000000000..62f3ac629 --- /dev/null +++ b/product_profit_report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import report +from . import wizard diff --git a/product_profit_report/__manifest__.py b/product_profit_report/__manifest__.py new file mode 100644 index 000000000..e49e48f22 --- /dev/null +++ b/product_profit_report/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': 'Product Profit Report', + 'version': '12.0.1.0.0', + 'category': 'Productivity', + 'summary': 'The product profit report module provides detailed insights ' + 'and analysis on the profitability of individual products', + 'description': 'This module generates a report specifically focused on ' + 'analyzing the profitability of different products within ' + 'a business. This module provides valuable insights into ' + 'the financial performance of individual products, ' + 'allowing businesses to make informed decisions regarding ' + 'their product offerings, pricing strategies, and resource ' + 'allocation.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['account'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/product_profit_report_views.xml', + 'report/product_profit_report_templates.xml', + 'report/product_profit_report.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/product_profit_report/doc/RELEASE_NOTES.md b/product_profit_report/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..4fbf339d5 --- /dev/null +++ b/product_profit_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 27.09.2023 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Product Profit Report. diff --git a/product_profit_report/report/__init__.py b/product_profit_report/report/__init__.py new file mode 100644 index 000000000..90ca3bb7a --- /dev/null +++ b/product_profit_report/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import product_profit_report diff --git a/product_profit_report/report/product_profit_report.py b/product_profit_report/report/product_profit_report.py new file mode 100644 index 000000000..1e3db4b2d --- /dev/null +++ b/product_profit_report/report/product_profit_report.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class ReportRender(models.AbstractModel): + """Model to print the report""" + _name = 'report.product_profit_report.product_profit_report' + _description = 'Product Profit Report Render' + + @api.multi + def _get_report_values(self, docid, data): + """This method takes the value to the pdf report""" + return self.generate_report_values(data['form']) + + @api.model + def generate_report_values(self, data): + """Generate values for the report based on condition""" + domain = [('invoice_id.date_invoice', '>=', data['from_date']), + ('invoice_id.date_invoice', '<=', data['to_date']), + ('invoice_id.state', 'in', ['open', 'paid']), + ('company_id', '=', data['company_id'][0]), + ('invoice_id.type', 'in', ['out_invoice', 'out_refund'])] + if data['from_date'] > data['to_date']: + raise ValidationError(_('From date must be less than To date')) + if data['product_id']: + domain += [('product_id.id', '=', data['product_id'][0])] + orders = self.env['account.invoice.line'].search(domain, order='name') + groups = {} + for order in orders: + if order.product_id.id in data['product_product_ids']: + dic_name = str(order.product_id.id) + quantity = order.quantity + price = quantity * (order.price_unit - order.discount) + expense = order.product_id.get_history_price( + order.company_id.id, + date=order.invoice_id.date_invoice) * quantity + if expense == 0.0: + expense = order.product_id.standard_price * quantity + if order.invoice_id.type == 'out_refund': + quantity = -quantity + price = -price + expense = -expense + profit = price - expense + if not groups.get(dic_name): + groups[dic_name] = {} + groups[dic_name].update({ + 'qty': quantity, + 'unit': order.product_id.uom_id.name, + 'sales': price, + 'expense': expense, + 'profit': profit, + 'name': order.product_id.name + }) + else: + groups[dic_name].update({ + 'qty': groups[dic_name].get('qty') + quantity, + 'sales': groups[dic_name].get('sales') + price, + 'expense': groups[dic_name].get('expense') + expense, + 'profit': groups[dic_name].get('profit') + profit + }) + return { + 'data': data, + 'groups': groups, + 'report_date': fields.Datetime.now().strftime("%Y-%m-%d"), + } diff --git a/product_profit_report/report/product_profit_report.xml b/product_profit_report/report/product_profit_report.xml new file mode 100644 index 000000000..1acf40c96 --- /dev/null +++ b/product_profit_report/report/product_profit_report.xml @@ -0,0 +1,13 @@ + + + + + Product Profit Report + product.profit.report + qweb-pdf + product_profit_report.product_profit_report + product_profit_report.product_profit_report + + report + + diff --git a/product_profit_report/report/product_profit_report_templates.xml b/product_profit_report/report/product_profit_report_templates.xml new file mode 100644 index 000000000..a74eb9f7f --- /dev/null +++ b/product_profit_report/report/product_profit_report_templates.xml @@ -0,0 +1,168 @@ + + + + + diff --git a/product_profit_report/security/ir.model.access.csv b/product_profit_report/security/ir.model.access.csv new file mode 100644 index 000000000..7df0bbc2c --- /dev/null +++ b/product_profit_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_product_profit_report_manager,access.product.profit.report.manager,model_product_profit_report,account.group_account_manager,1,1,1,1 +access_product_profit_report_user,access.product.profit.report.user,model_product_profit_report,account.group_account_user,1,0,0,0 diff --git a/product_profit_report/static/description/assets/icons/check.png b/product_profit_report/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/product_profit_report/static/description/assets/icons/check.png differ diff --git a/product_profit_report/static/description/assets/icons/chevron.png b/product_profit_report/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/chevron.png differ diff --git a/product_profit_report/static/description/assets/icons/cogs.png b/product_profit_report/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/cogs.png differ diff --git a/product_profit_report/static/description/assets/icons/consultation.png b/product_profit_report/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_profit_report/static/description/assets/icons/consultation.png differ diff --git a/product_profit_report/static/description/assets/icons/ecom-black.png b/product_profit_report/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/ecom-black.png differ diff --git a/product_profit_report/static/description/assets/icons/education-black.png b/product_profit_report/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_profit_report/static/description/assets/icons/education-black.png differ diff --git a/product_profit_report/static/description/assets/icons/hotel-black.png b/product_profit_report/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_profit_report/static/description/assets/icons/hotel-black.png differ diff --git a/product_profit_report/static/description/assets/icons/license.png b/product_profit_report/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_profit_report/static/description/assets/icons/license.png differ diff --git a/product_profit_report/static/description/assets/icons/lifebuoy.png b/product_profit_report/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_profit_report/static/description/assets/icons/lifebuoy.png differ diff --git a/product_profit_report/static/description/assets/icons/logo.png b/product_profit_report/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/product_profit_report/static/description/assets/icons/logo.png differ diff --git a/product_profit_report/static/description/assets/icons/manufacturing-black.png b/product_profit_report/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_profit_report/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_profit_report/static/description/assets/icons/pos-black.png b/product_profit_report/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/pos-black.png differ diff --git a/product_profit_report/static/description/assets/icons/puzzle.png b/product_profit_report/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/puzzle.png differ diff --git a/product_profit_report/static/description/assets/icons/restaurant-black.png b/product_profit_report/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/restaurant-black.png differ diff --git a/product_profit_report/static/description/assets/icons/service-black.png b/product_profit_report/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_profit_report/static/description/assets/icons/service-black.png differ diff --git a/product_profit_report/static/description/assets/icons/trading-black.png b/product_profit_report/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_profit_report/static/description/assets/icons/trading-black.png differ diff --git a/product_profit_report/static/description/assets/icons/training.png b/product_profit_report/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_profit_report/static/description/assets/icons/training.png differ diff --git a/product_profit_report/static/description/assets/icons/update.png b/product_profit_report/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_profit_report/static/description/assets/icons/update.png differ diff --git a/product_profit_report/static/description/assets/icons/user.png b/product_profit_report/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_profit_report/static/description/assets/icons/user.png differ diff --git a/product_profit_report/static/description/assets/icons/wrench.png b/product_profit_report/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_profit_report/static/description/assets/icons/wrench.png differ diff --git a/product_profit_report/static/description/assets/misc/categories.png b/product_profit_report/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/categories.png differ diff --git a/product_profit_report/static/description/assets/misc/check-box.png b/product_profit_report/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/check-box.png differ diff --git a/product_profit_report/static/description/assets/misc/compass.png b/product_profit_report/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/product_profit_report/static/description/assets/misc/compass.png differ diff --git a/product_profit_report/static/description/assets/misc/corporate.png b/product_profit_report/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/product_profit_report/static/description/assets/misc/corporate.png differ diff --git a/product_profit_report/static/description/assets/misc/customer-support.png b/product_profit_report/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/product_profit_report/static/description/assets/misc/customer-support.png differ diff --git a/product_profit_report/static/description/assets/misc/cybrosys-logo.png b/product_profit_report/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/product_profit_report/static/description/assets/misc/cybrosys-logo.png differ diff --git a/product_profit_report/static/description/assets/misc/features.png b/product_profit_report/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/features.png differ diff --git a/product_profit_report/static/description/assets/misc/logo.png b/product_profit_report/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/product_profit_report/static/description/assets/misc/logo.png differ diff --git a/product_profit_report/static/description/assets/misc/pictures.png b/product_profit_report/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/pictures.png differ diff --git a/product_profit_report/static/description/assets/misc/pie-chart.png b/product_profit_report/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/pie-chart.png differ diff --git a/product_profit_report/static/description/assets/misc/right-arrow.png b/product_profit_report/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/right-arrow.png differ diff --git a/product_profit_report/static/description/assets/misc/star.png b/product_profit_report/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/product_profit_report/static/description/assets/misc/star.png differ diff --git a/product_profit_report/static/description/assets/misc/support.png b/product_profit_report/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/support.png differ diff --git a/product_profit_report/static/description/assets/misc/whatsapp.png b/product_profit_report/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/whatsapp.png differ diff --git a/product_profit_report/static/description/assets/modules/1.jpg b/product_profit_report/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..ccb8e1556 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/1.jpg differ diff --git a/product_profit_report/static/description/assets/modules/2.jpg b/product_profit_report/static/description/assets/modules/2.jpg new file mode 100755 index 000000000..9b8e25189 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/2.jpg differ diff --git a/product_profit_report/static/description/assets/modules/3.jpg b/product_profit_report/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..5da168516 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/3.jpg differ diff --git a/product_profit_report/static/description/assets/modules/4.jpg b/product_profit_report/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..9360137da Binary files /dev/null and b/product_profit_report/static/description/assets/modules/4.jpg differ diff --git a/product_profit_report/static/description/assets/modules/5.jpg b/product_profit_report/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..d048dde7d Binary files /dev/null and b/product_profit_report/static/description/assets/modules/5.jpg differ diff --git a/product_profit_report/static/description/assets/modules/6.jpg b/product_profit_report/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..e10c28799 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/6.jpg differ diff --git a/product_profit_report/static/description/assets/screenshots.zip b/product_profit_report/static/description/assets/screenshots.zip new file mode 100644 index 000000000..140dcf030 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots.zip differ diff --git a/product_profit_report/static/description/assets/screenshots/1.png b/product_profit_report/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..d45558fa0 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/1.png differ diff --git a/product_profit_report/static/description/assets/screenshots/2.png b/product_profit_report/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..50edf9f46 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/2.png differ diff --git a/product_profit_report/static/description/assets/screenshots/3.png b/product_profit_report/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..7e180f0b6 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/3.png differ diff --git a/product_profit_report/static/description/assets/screenshots/hero.gif b/product_profit_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..612e7b1a3 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/hero.gif differ diff --git a/product_profit_report/static/description/banner.jpg b/product_profit_report/static/description/banner.jpg new file mode 100644 index 000000000..31683ea59 Binary files /dev/null and b/product_profit_report/static/description/banner.jpg differ diff --git a/product_profit_report/static/description/icon.png b/product_profit_report/static/description/icon.png new file mode 100644 index 000000000..e222495a8 Binary files /dev/null and b/product_profit_report/static/description/icon.png differ diff --git a/product_profit_report/static/description/index.html b/product_profit_report/static/description/index.html new file mode 100644 index 000000000..a23d79df1 --- /dev/null +++ b/product_profit_report/static/description/index.html @@ -0,0 +1,501 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Product Profit Report

+

This Module let you Generate Product Wise Profit Report.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ With this module you can generate Product Wise Profit Report. It gives a clear view of which products + and product mixes are cost-effective. In addition to managing current results, the analysis can + refine product pricing strategies +
+
+ + +
+
+ +
+

Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + Support in Desktop & Mobile. +
+
+ + Generate product wise profit report +
+
+
+ + +
+
+ +
+

Screenshots +

+
+
+
+
+

Print Product-Profit Report +

+

+ Choose the Product Profit Report menu item from Reporting Menu

+ +
+
+
Fill the details +
+

Click ->PDF button to print the PDF Report + +

+ We will get the printed report

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

Suggested + Products +

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

Our Services +

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

Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/product_profit_report/wizard/__init__.py b/product_profit_report/wizard/__init__.py new file mode 100644 index 000000000..90ca3bb7a --- /dev/null +++ b/product_profit_report/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import product_profit_report diff --git a/product_profit_report/wizard/product_profit_report.py b/product_profit_report/wizard/product_profit_report.py new file mode 100644 index 000000000..d22c68491 --- /dev/null +++ b/product_profit_report/wizard/product_profit_report.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import api, fields, models + + +class ProductProfitReport(models.TransientModel): + """Transient model to popup when click on the Product Profit Report in + reporting tab""" + _name = "product.profit.report" + _description = 'Product Profit Report' + + @api.model + def _get_from_date(self): + """This methode returns first day in the year""" + return self.env.user.company_id.compute_fiscalyear_dates( + fields.Date.today())['date_from'] + + from_date = fields.Date(string='From Date', default=_get_from_date, + required=True, + help="From which date report need to print") + to_date = fields.Date(string='To Date', default=fields.Date.context_today, + required=True, + help="Date before which report need to print") + company_id = fields.Many2one( + 'res.company', string='Company', required=True, + default=lambda self: self.env.user.company_id.id, + help="Select your company (only show when multi company is enabled") + categ_id = fields.Many2one('product.category', string='Product Category', + required=True, help="Choose product category") + product_id = fields.Many2one('product.product', string='Product', + help="Select the product") + product_product_ids = fields.Many2many( + 'product.product', string="Products", + help="When chosen the product category only the product in that " + "category shows for this we use this field as a domain") + + def get_all_child_categories(self, category): + """This function returns all child categories""" + all_child_ids = category.child_id.ids + for child_category in category.child_id: + all_child_ids += self.get_all_child_categories(child_category) + return all_child_ids + + @api.onchange('categ_id') + def _onchange_categ_id(self): + """Show products that correspond to the selected category""" + self.product_id = False + if self.categ_id: + self.product_product_ids = [ + (6, 0, self.env['product.product'].search( + [('categ_id', 'in', [ + self.categ_id.id] + self.get_all_child_categories( + self.categ_id))]).ids)] + else: + self.product_product_ids = [(5, 0, 0)] + + def action_print_pdf_report(self): + """Print the pdf report""" + data = {'form': {}} + data['form'].update(self.read([])[0]) + return self.env.ref( + 'product_profit_report.product_profit_report_action'). \ + with_context(landscape=True).report_action(self, data=data) diff --git a/product_profit_report/wizard/product_profit_report_views.xml b/product_profit_report/wizard/product_profit_report_views.xml new file mode 100644 index 000000000..80b53aac7 --- /dev/null +++ b/product_profit_report/wizard/product_profit_report_views.xml @@ -0,0 +1,52 @@ + + + + + product.profit.report.view.form + product.profit.report + +
+ + + + + + + + + + + + + + +
+
+
+
+
+ + + Product Profit Report + product.profit.report + ir.actions.act_window + form + form + + new + + + +