diff --git a/product_profit_report/README.rst b/product_profit_report/README.rst new file mode 100644 index 000000000..0c1c16b20 --- /dev/null +++ b/product_profit_report/README.rst @@ -0,0 +1,47 @@ +.. 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 +====================== +User can print profit report for each product. + +Configuration +============= +-No additional configuration needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V15) Mohamed Muzammil VP @cybrosys, +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..2ffcf89d1 --- /dev/null +++ b/product_profit_report/__init__.py @@ -0,0 +1,24 @@ +# -*- 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 models +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..73ea8bd4c --- /dev/null +++ b/product_profit_report/__manifest__.py @@ -0,0 +1,47 @@ +# -*- 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': '15.0.1.0.0', + 'category': 'Productivity', + 'summary': 'User can print profit report for each product', + 'description': 'The report provides a breakdown of profit and loss for ' + 'each individual product, allowing businesses to assess ' + 'the financial performance of specific items within their ' + 'inventory.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'sale_management', 'account'], + 'data': [ + 'security/ir.model.access.csv', + 'report/product_profit_report_templates.xml', + 'report/product_profit_report.xml', + 'wizard/product_profit_report_views.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..b8afb7e90 --- /dev/null +++ b/product_profit_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.11.2023 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Product Profit Report. diff --git a/product_profit_report/models/__init__.py b/product_profit_report/models/__init__.py new file mode 100644 index 000000000..55728a1d6 --- /dev/null +++ b/product_profit_report/models/__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 price_history +from . import product_product diff --git a/product_profit_report/models/price_history.py b/product_profit_report/models/price_history.py new file mode 100644 index 000000000..b14778c6e --- /dev/null +++ b/product_profit_report/models/price_history.py @@ -0,0 +1,47 @@ +# -*- 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 fields, models +from odoo.addons import decimal_precision as dp + + +class PriceHistory(models.Model): + """ + Keep track of the price of products standard prices as they are changed. + """ + _name = 'price.history' + _description = "Products Price history" + _order = 'datetime desc' + + def _get_default_company_id(self): + """Returns default company of the user""" + return self._context.get('force_company', self.env.user.company_id.id) + + company_id = fields.Many2one('res.company', string='Company', + default=_get_default_company_id, + required=True, help="Choose your company") + product_id = fields.Many2one('product.product', 'Product', + ondelete='cascade', required=True, + help="Choose product") + datetime = fields.Datetime('Date', default=fields.Datetime.now, + help="Choose the date") + cost = fields.Float('Cost', digits=dp.get_precision('Product Price'), + help="Product price") diff --git a/product_profit_report/models/product_product.py b/product_profit_report/models/product_product.py new file mode 100644 index 000000000..e292e5c58 --- /dev/null +++ b/product_profit_report/models/product_product.py @@ -0,0 +1,36 @@ +# -*- 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 fields, models + + +class ProductProduct(models.Model): + """Inheriting the product.product model and add a function to it""" + _inherit = 'product.product' + + def get_history_price(self, company_id, date=None): + """To get the previous price of the product""" + history = self.env['price.history'].search([ + ('company_id', '=', company_id), + ('product_id', 'in', self.ids), + ('datetime', '<=', date or fields.Datetime.now())], + order='datetime desc,id desc', limit=1) + return history.cost or 0.0 diff --git a/product_profit_report/report/__init__.py b/product_profit_report/report/__init__.py new file mode 100644 index 000000000..70b4d11d5 --- /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..9c30b92ad --- /dev/null +++ b/product_profit_report/report/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, _ +from odoo.exceptions import ValidationError + + +class ReportRender(models.AbstractModel): + """Abstract model to print the report""" + _name = 'report.product_profit_report.action_product_profit_report' + _description = 'Product profit Report Render' + + 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 = [('move_id.invoice_date', '>=', data['from_date']), + ('move_id.invoice_date', '<=', data['to_date']), + ('move_id.state', 'in', ['posted', 'paid']), + ('company_id', '=', data['company_id'][0]), + ('move_id.move_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.move.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.move_id.invoice_date) * quantity + if expense == 0.0: + expense = order.product_id.standard_price * quantity + if order.move_id.move_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..2e1cde80c --- /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.action_product_profit_report + product_profit_report.action_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..6baf51492 --- /dev/null +++ b/product_profit_report/report/product_profit_report_templates.xml @@ -0,0 +1,169 @@ + + + + + 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..47d568412 --- /dev/null +++ b/product_profit_report/security/ir.model.access.csv @@ -0,0 +1,5 @@ +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 +access_price_history_manager,access.price.history.manager,model_price_history,account.group_account_manager,1,1,1,1 +access_price_history_user,access.price.history.user,model_price_history,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.png b/product_profit_report/static/description/assets/modules/1.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/1.png differ diff --git a/product_profit_report/static/description/assets/modules/2.png b/product_profit_report/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/product_profit_report/static/description/assets/modules/2.png differ diff --git a/product_profit_report/static/description/assets/modules/3.png b/product_profit_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/product_profit_report/static/description/assets/modules/3.png differ diff --git a/product_profit_report/static/description/assets/modules/4.png b/product_profit_report/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/product_profit_report/static/description/assets/modules/4.png differ diff --git a/product_profit_report/static/description/assets/modules/5.gif b/product_profit_report/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/product_profit_report/static/description/assets/modules/5.gif differ diff --git a/product_profit_report/static/description/assets/modules/6.png b/product_profit_report/static/description/assets/modules/6.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/product_profit_report/static/description/assets/modules/6.png 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..70233ceba 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..3c5d0c6a4 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..c8b55d1f2 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..897d06a16 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..a4adceea0 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..12c1707b5 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..0e3f60bd2 --- /dev/null +++ b/product_profit_report/static/description/index.html @@ -0,0 +1,541 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Product Profit Report

+

This Module Let You Generate Product Wise Profit Report.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ The report provides a breakdown of profit and loss for each individual product, + allowing businesses to assess the financial performance of specific items + within their inventory. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Support in Desktop. +
+
+
+
+ + Support in 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/product_profit_report/wizard/__init__.py b/product_profit_report/wizard/__init__.py new file mode 100644 index 000000000..70b4d11d5 --- /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..ec782c03c --- /dev/null +++ b/product_profit_report/wizard/product_profit_report.py @@ -0,0 +1,84 @@ +# -*- 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 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""" + from_date = self.env.user.company_id.compute_fiscalyear_dates( + fields.Date.today())['date_from'] + return from_date + + 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', + help="Choose Product category", required=True) + 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: + category_ids = [self.categ_id.id] + self.get_all_child_categories( + self.categ_id) + product_domain = [('categ_id', 'in', category_ids)] + products = self.env['product.product'].search(product_domain) + self.product_product_ids = [(6, 0, products.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..9ac5a499f --- /dev/null +++ b/product_profit_report/wizard/product_profit_report_views.xml @@ -0,0 +1,51 @@ + + + + + product.profit.report.view.form + product.profit.report + +
+ + + + + + + + + + + + + + +
+
+
+
+
+ + + Product Profit Report + product.profit.report + ir.actions.act_window + form + + new + + + +