diff --git a/product_profit_report/README.rst b/product_profit_report/README.rst new file mode 100644 index 000000000..d9ebeadf7 --- /dev/null +++ b/product_profit_report/README.rst @@ -0,0 +1,49 @@ +.. 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. + +Configuration +============= +No additional Configuration + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: + (V16)Mohamed Muzammil VP , + (V17) Anjhana A K , +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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/product_profit_report/__init__.py b/product_profit_report/__init__.py new file mode 100644 index 000000000..6bb3d42d2 --- /dev/null +++ b/product_profit_report/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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..ceca5591f --- /dev/null +++ b/product_profit_report/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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': '17.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': ['sale_management'], + 'data': [ + 'security/ir.model.access.csv', + 'report/product_profit_report_templates.xml', + 'report/profit_product_report_views.xml', + 'wizard/profit_product_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..987c18ef6 --- /dev/null +++ b/product_profit_report/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 20.02.2024 +#### Version 17.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..a9736c790 --- /dev/null +++ b/product_profit_report/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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..53b619652 --- /dev/null +++ b/product_profit_report/models/price_history.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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', string='Product', + ondelete='cascade', required=True, + help="Choose product") + datetime = fields.Datetime(string='Date', default=fields.Datetime.now, + help="Choose the date") + cost = fields.Float(string='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..b4945a60e --- /dev/null +++ b/product_profit_report/models/product_product.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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""" + return 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).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..b1b70e6c8 --- /dev/null +++ b/product_profit_report/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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..e53fc91bf --- /dev/null +++ b/product_profit_report/report/product_profit_report.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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 . +# +################################################################################ +import datetime +from odoo import api, models, _ +from odoo.exceptions import ValidationError + + +class ProductProfitReport(models.AbstractModel): + """Abstract model to print the report""" + _name = 'report.product_profit_report.product_profit_report' + _description = 'Product profit Report Render' + + def _get_report_values(self, docids, data): + """This method takes the value to the pdf report""" + model_data = data['form'] + return self.generate_report_values(model_data) + + @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'] and data['product_id'] in data['product_product_ids']: + domain += [('product_id.id', '=', data['product_id'][0])] + else: + domain += [('product_id', 'in', data['product_product_ids'])] + orders = self.env['account.move.line'].search(domain, order='name') + groups = {} + for order in orders: + dic_name = 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': datetime.datetime.now().strftime("%Y-%m-%d"), + } 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..076ed4407 --- /dev/null +++ b/product_profit_report/report/product_profit_report_templates.xml @@ -0,0 +1,162 @@ + + + + + diff --git a/product_profit_report/report/profit_product_report_views.xml b/product_profit_report/report/profit_product_report_views.xml new file mode 100644 index 000000000..85716cd4c --- /dev/null +++ b/product_profit_report/report/profit_product_report_views.xml @@ -0,0 +1,13 @@ + + + + + Profit Report + profit.product + qweb-pdf + product_profit_report.product_profit_report + product_profit_report.product_profit_report + + report + + 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..f1a39d878 --- /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_profit_product_manager,access.profit.product.manager,model_profit_product,account.group_account_manager,1,1,1,1 +access_profit_product_user,access.profit.product.user,model_profit_product,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/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/Cybrosys R.png b/product_profit_report/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/product_profit_report/static/description/assets/misc/Cybrosys R.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/email.svg b/product_profit_report/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/phone.svg b/product_profit_report/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + 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 (1) 2.svg b/product_profit_report/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/product_profit_report/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + 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 (1) 1.svg b/product_profit_report/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_profit_report/static/description/assets/misc/support-email.svg b/product_profit_report/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + 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/tick-mark.svg b/product_profit_report/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/product_profit_report/static/description/assets/misc/whatsapp 1.svg b/product_profit_report/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/product_profit_report/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + 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/misc/whatsapp.svg b/product_profit_report/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/product_profit_report/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..67c7f7062 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 100644 index 000000000..87c2bb2ba 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.png b/product_profit_report/static/description/assets/modules/3.png new file mode 100644 index 000000000..a5299d338 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..a0ac2d840 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.jpg b/product_profit_report/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..6a102f103 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..eaf13fef5 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/hero.gif b/product_profit_report/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..98ae537a6 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/hero.gif differ diff --git a/product_profit_report/static/description/assets/screenshots/screenshot1.png b/product_profit_report/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..d64183339 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/screenshot1.png differ diff --git a/product_profit_report/static/description/assets/screenshots/screenshot2.png b/product_profit_report/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..e50640012 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/screenshot2.png differ diff --git a/product_profit_report/static/description/assets/screenshots/screenshot3.png b/product_profit_report/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..12bdadb26 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/screenshot3.png differ diff --git a/product_profit_report/static/description/assets/screenshots/screenshot4.png b/product_profit_report/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..7b26586e5 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/screenshot4.png differ diff --git a/product_profit_report/static/description/assets/screenshots/screenshot5.png b/product_profit_report/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..ff628c1a7 Binary files /dev/null and b/product_profit_report/static/description/assets/screenshots/screenshot5.png 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..fd5d548f1 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..251dfa968 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..f6dffe10d --- /dev/null +++ b/product_profit_report/static/description/index.html @@ -0,0 +1,693 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Product Profit Report

+

+ This Module let you Generate Product Wise Profit Report. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Product Profit Report

+

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. +

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

+ Choose the Product Profit Report menu item from Reporting Menu

+
+
+
+
+
+ + +
+
+
+

+ Fill the details, if we specify Product category only then all the product profit under that category would be printed. To print product profit report click "PDF" button

+
+
+
+
+
+ + +
+
+
+

+ Printed product profit report

+
+
+
+
+
+ + +
+
+

+ If we specify the product along with product category , then the product profit report of that particular product will be printed

+
+
+
+
+
+
+ + +
+
+

+ Printed product profit report

+
+
+
+
+ +
+
+
    +
  • + Support in Odoo Community and Enterprise. +
  • +
  • + Generate product wise profit report. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:20th February 2024 +
+

+ + Initial Commit for Product Profit Report.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

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

Odoo + Customization

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

Odoo + Implementation

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

Odoo + Support

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

Hire + Odoo Developer

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

Odoo + Integration

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

Odoo + Migration

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

Odoo + Consultancy

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

Odoo + Implementation

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

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

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

Got + questions or need help? Get in touch.

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

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + diff --git a/product_profit_report/wizard/__init__.py b/product_profit_report/wizard/__init__.py new file mode 100644 index 000000000..4232b2f37 --- /dev/null +++ b/product_profit_report/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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 profit_product diff --git a/product_profit_report/wizard/profit_product.py b/product_profit_report/wizard/profit_product.py new file mode 100644 index 000000000..ffe921dfe --- /dev/null +++ b/product_profit_report/wizard/profit_product.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anjhana A K (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 ProfitProduct(models.TransientModel): + """Transient model for wizard""" + _name = "profit.product" + _description = 'Product Profit' + + @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""" + report_action = self.env.ref( + 'product_profit_report.product_profit_report_action') + return report_action.with_context(landscape=True).report_action( + self, data={'form': self.read([])[0]}) diff --git a/product_profit_report/wizard/profit_product_views.xml b/product_profit_report/wizard/profit_product_views.xml new file mode 100644 index 000000000..4df0b18fe --- /dev/null +++ b/product_profit_report/wizard/profit_product_views.xml @@ -0,0 +1,52 @@ + + + + + profit.product.view.form + profit.product + +
+ + + + + + + + + + + + + + +
+
+ +
+
+
+ + + Profit Report + profit.product + ir.actions.act_window + form + + new + + + +