diff --git a/export_stockinfo_xls/README.rst b/export_stockinfo_xls/README.rst new file mode 100644 index 000000000..eacaf097c --- /dev/null +++ b/export_stockinfo_xls/README.rst @@ -0,0 +1,53 @@ +.. 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 + +Export Product Stock in Excel +============================= +Advanced PDF & XLS reports for Product Stock. + +Features +======== +* Retrieve the current stock report in XLS format for the corresponding warehouse. + +Configuration +============= +Nothing to configure. + +License +------- +Affero General Public License, v3.0 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V15) Midilaj V K, + (V16) Sahla Sherin, + (V17) Farhana Jahan PT, + 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/export_stockinfo_xls/__init__.py b/export_stockinfo_xls/__init__.py new file mode 100644 index 000000000..45bdc4cd5 --- /dev/null +++ b/export_stockinfo_xls/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 controllers +from . import models +from . import wizard diff --git a/export_stockinfo_xls/__manifest__.py b/export_stockinfo_xls/__manifest__.py new file mode 100644 index 000000000..067011829 --- /dev/null +++ b/export_stockinfo_xls/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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': 'Export Product Stock in Excel', + 'version': '17.0.1.0.0', + 'summary': 'Advanced PDF & XLS reports for Product Stock.', + 'description': 'Advanced PDF & XLS reports for Product Stock by' + 'corresponding warehouse and product categories.', + 'category': 'Warehouse', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': [ + 'sale_management', + 'stock', + 'purchase', + ], + 'website': 'https://www.cybrosys.com', + 'data': [ + 'security/ir.model.access.csv', + 'wizard/stock_report_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'export_stockinfo_xls/static/src/js/action_manager.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'auto_install': False, +} diff --git a/export_stockinfo_xls/controllers/__init__.py b/export_stockinfo_xls/controllers/__init__.py new file mode 100644 index 000000000..a7b3b330a --- /dev/null +++ b/export_stockinfo_xls/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 export_stockinfo_xls diff --git a/export_stockinfo_xls/controllers/export_stockinfo_xls.py b/export_stockinfo_xls/controllers/export_stockinfo_xls.py new file mode 100644 index 000000000..4efb8f47b --- /dev/null +++ b/export_stockinfo_xls/controllers/export_stockinfo_xls.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 json + +from odoo import http +from odoo.http import content_disposition, request, \ + serialize_exception as _serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """Controller to generate and print XLS reports.""" + + @http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], + csrf=False) + def get_report_xlsx(self, model, options, output_format, report_name): + """Function to retrieve an XLS report.""" + report_obj = request.env[model].with_user(request.session.uid) + options = json.loads(options) + token = 'dummy-because-api-expects-one' + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[ + ('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', + content_disposition(report_name + '.xlsx')) + ] + ) + report_obj.get_xlsx_report(options, response) + response.set_cookie('fileToken', token) + return response + except Exception as e: + se = _serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': se + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/export_stockinfo_xls/doc/RELEASE_NOTES.md b/export_stockinfo_xls/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d273c86c6 --- /dev/null +++ b/export_stockinfo_xls/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 13.11.2023 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Export Product Stock in Excel diff --git a/export_stockinfo_xls/models/__init__.py b/export_stockinfo_xls/models/__init__.py new file mode 100644 index 000000000..31fbd1783 --- /dev/null +++ b/export_stockinfo_xls/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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_category +from . import res_partner +from . import stock_warehouse diff --git a/export_stockinfo_xls/models/product_category.py b/export_stockinfo_xls/models/product_category.py new file mode 100644 index 000000000..868081c2a --- /dev/null +++ b/export_stockinfo_xls/models/product_category.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 ProductCategory(models.Model): + """Inherit the 'product_category' to add the 'stock_report_ids' field, + which should be set as invisible.""" + _inherit = 'product.category' + + stock_report_ids = fields.Many2many('stock.xls.report', + string="Stock Report", + help="Retrieve Stock Report IDs.", + invisible=True) diff --git a/export_stockinfo_xls/models/res_partner.py b/export_stockinfo_xls/models/res_partner.py new file mode 100644 index 000000000..bb567b983 --- /dev/null +++ b/export_stockinfo_xls/models/res_partner.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 ResPartner(models.Model): + """Inherit the 'res_partner' to add the 'stock_report_ids' field, + which should be set as invisible.""" + _inherit = 'res.partner' + + stock_report_ids = fields.Many2many('stock.xls.report', + string="Stock Report", + help="Retrieve Stock Report IDs.", + invisible=True) diff --git a/export_stockinfo_xls/models/stock_warehouse.py b/export_stockinfo_xls/models/stock_warehouse.py new file mode 100644 index 000000000..b0723c0ff --- /dev/null +++ b/export_stockinfo_xls/models/stock_warehouse.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 StockWarehouse(models.Model): + """Inherit the 'stock_warehouse' to add the 'stock_report_ids' field, + which should be set as invisible.""" + _inherit = 'stock.warehouse' + + stock_report_ids = fields.Many2many('stock.xls.report', + string="Stock Report", + help="Retrieve Stock Report IDs.", + invisible=True) diff --git a/export_stockinfo_xls/security/ir.model.access.csv b/export_stockinfo_xls/security/ir.model.access.csv new file mode 100644 index 000000000..4b2df9ead --- /dev/null +++ b/export_stockinfo_xls/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_xls_report_manager,stock.xls.report,model_stock_xls_report,stock.group_stock_manager,1,1,1,1 diff --git a/export_stockinfo_xls/static/description/assets/icons/capture (1).png b/export_stockinfo_xls/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/capture (1).png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/check.png b/export_stockinfo_xls/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/check.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/chevron.png b/export_stockinfo_xls/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/chevron.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/cogs.png b/export_stockinfo_xls/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/cogs.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/consultation.png b/export_stockinfo_xls/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/consultation.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/ecom-black.png b/export_stockinfo_xls/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/ecom-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/education-black.png b/export_stockinfo_xls/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/education-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/hotel-black.png b/export_stockinfo_xls/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/hotel-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/img.png b/export_stockinfo_xls/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/img.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/license.png b/export_stockinfo_xls/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/license.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/lifebuoy.png b/export_stockinfo_xls/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/lifebuoy.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/manufacturing-black.png b/export_stockinfo_xls/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/manufacturing-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/photo-capture.png b/export_stockinfo_xls/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/photo-capture.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/pos-black.png b/export_stockinfo_xls/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/pos-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/puzzle.png b/export_stockinfo_xls/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/puzzle.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/restaurant-black.png b/export_stockinfo_xls/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/restaurant-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/service-black.png b/export_stockinfo_xls/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/service-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/trading-black.png b/export_stockinfo_xls/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/trading-black.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/training.png b/export_stockinfo_xls/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/training.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/update.png b/export_stockinfo_xls/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/update.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/user.png b/export_stockinfo_xls/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/user.png differ diff --git a/export_stockinfo_xls/static/description/assets/icons/wrench.png b/export_stockinfo_xls/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/icons/wrench.png differ diff --git a/export_stockinfo_xls/static/description/assets/misc/Cybrosys R.png b/export_stockinfo_xls/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/misc/Cybrosys R.png differ diff --git a/export_stockinfo_xls/static/description/assets/misc/email.svg b/export_stockinfo_xls/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/phone.svg b/export_stockinfo_xls/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/star (1) 2.svg b/export_stockinfo_xls/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/support (1) 1.svg b/export_stockinfo_xls/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/support-email.svg b/export_stockinfo_xls/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/tick-mark.svg b/export_stockinfo_xls/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/whatsapp 1.svg b/export_stockinfo_xls/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/misc/whatsapp.svg b/export_stockinfo_xls/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/export_stockinfo_xls/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/export_stockinfo_xls/static/description/assets/modules/1.png b/export_stockinfo_xls/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/1.png differ diff --git a/export_stockinfo_xls/static/description/assets/modules/2.png b/export_stockinfo_xls/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/2.png differ diff --git a/export_stockinfo_xls/static/description/assets/modules/3.png b/export_stockinfo_xls/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/3.png differ diff --git a/export_stockinfo_xls/static/description/assets/modules/4.png b/export_stockinfo_xls/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/4.png differ diff --git a/export_stockinfo_xls/static/description/assets/modules/5.png b/export_stockinfo_xls/static/description/assets/modules/5.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/5.png differ diff --git a/export_stockinfo_xls/static/description/assets/modules/6.png b/export_stockinfo_xls/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/modules/6.png differ diff --git a/export_stockinfo_xls/static/description/assets/screenshots/1.png b/export_stockinfo_xls/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..be333f126 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/screenshots/1.png differ diff --git a/export_stockinfo_xls/static/description/assets/screenshots/2.png b/export_stockinfo_xls/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..9ea6f2720 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/screenshots/2.png differ diff --git a/export_stockinfo_xls/static/description/assets/screenshots/3.png b/export_stockinfo_xls/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..4d9462daf Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/screenshots/3.png differ diff --git a/export_stockinfo_xls/static/description/assets/screenshots/hero.gif b/export_stockinfo_xls/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d624de6f5 Binary files /dev/null and b/export_stockinfo_xls/static/description/assets/screenshots/hero.gif differ diff --git a/export_stockinfo_xls/static/description/banner.png b/export_stockinfo_xls/static/description/banner.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/export_stockinfo_xls/static/description/banner.png differ diff --git a/export_stockinfo_xls/static/description/icon.png b/export_stockinfo_xls/static/description/icon.png new file mode 100644 index 000000000..215a67b99 Binary files /dev/null and b/export_stockinfo_xls/static/description/icon.png differ diff --git a/export_stockinfo_xls/static/description/index.html b/export_stockinfo_xls/static/description/index.html new file mode 100644 index 000000000..e447f655f --- /dev/null +++ b/export_stockinfo_xls/static/description/index.html @@ -0,0 +1,710 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Export Product Stock in Excel

+

+ Advanced PDF & XLS reports for Product Stock. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Current Stock XLS.

+

Retrieve the + current stock report in XLS format for the + corresponding warehouse. +

+
+
+
+
+
+
+ +
+
+

+ Select Category for Products.

+

Ability to + select Product Categories for generating an XLS + report. +

+
+
+
+
+
+
+ +
+
+

+ Negative Stock.

+

Negative stock + will be + highlighted in "Red" cells. +

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

+ Navigate to the following steps: Reporting + -> Current Stock in Excel.

+
+
+
+
+
+
+ +
+
+

+ When selecting 'Current Stock in Excel,' a + Wizard will appear allowing the selection of + a Warehouse and Category.

+
+
+
+
+
+
+ +
+
+

+ When you click on 'Export Product with Stock + Info,' an XLS report is generated as + follows.

+
+
+
+
+
+
+
    +
  • + Current Stock XLS. +
  • +
  • + Select Category for Products. +
  • +
  • + Negative Stock. +
      +
    • +
    • +
    +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:13th nov 2023 +
+

+ + Initial Commit for Export Product Stock in Excel.

+
+
+
+
+
+
+
+

+ 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/export_stockinfo_xls/static/src/js/action_manager.js b/export_stockinfo_xls/static/src/js/action_manager.js new file mode 100644 index 000000000..fbf4b6bab --- /dev/null +++ b/export_stockinfo_xls/static/src/js/action_manager.js @@ -0,0 +1,16 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { download } from "@web/core/network/download"; +import { BlockUI } from "@web/core/ui/block_ui"; +// This function is responsible for generating and downloading an XLSX report. +registry.category("ir.actions.report handlers").add("stock_xlsx", async (action) => { + if (action.report_type === 'stock_xlsx') { + const blockUI = new BlockUI(); + await download({ + url: '/xlsx_reports', + data: action.data, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + } +}); diff --git a/export_stockinfo_xls/wizard/__init__.py b/export_stockinfo_xls/wizard/__init__.py new file mode 100644 index 000000000..930729994 --- /dev/null +++ b/export_stockinfo_xls/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 stock_report diff --git a/export_stockinfo_xls/wizard/stock_report.py b/export_stockinfo_xls/wizard/stock_report.py new file mode 100644 index 000000000..e0652df95 --- /dev/null +++ b/export_stockinfo_xls/wizard/stock_report.py @@ -0,0 +1,294 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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 io +import json +from datetime import datetime +import datetime +import pytz +from odoo import fields, models +from odoo.tools import date_utils + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class StockReport(models.TransientModel): + """Create a new model named 'stock_report' to implement a wizard. + This wizard will allow users to select warehouses and categories for + printing purposes.""" + + _name = "stock.xls.report" + _description = "Current Stock History" + + warehouse_ids = fields.Many2many('stock.warehouse', + string='Warehouse', + required=True) + category_ids = fields.Many2many('product.category', + string='Category') + + def export_xls(self): + """Function to retrieve and open an XLS report record.""" + data = { + 'ids': self.ids, + 'model': self._name, + 'warehouse': self.warehouse_ids.ids, + 'category': self.category_ids.ids, + } + return { + 'type': 'ir.actions.report', + 'data': {'model': 'stock.xls.report', + 'options': json.dumps(data, + default=date_utils.json_default), + 'output_format': 'xlsx', + 'report_name': 'Current Stock History', + }, + 'report_type': 'stock_xlsx' + } + + def get_warehouse(self, data): + """Function to retrieve all warehouses.""" + warehouse = self.env['stock.warehouse'].search( + [('id', 'in', data.warehouse_ids.mapped('id'))]) + warehouse_name = [rec.name for rec in warehouse] + warehouse_id = [rec.id for rec in warehouse] + return warehouse_name, warehouse_id + + def get_lines(self, data, warehouse_ids): + """Functions for retrieving data for an XLS report""" + lines = [] + if data.mapped('id'): + category_products = self.env['product.product'].search( + [('categ_id', 'in', data.mapped('id'))]) + else: + category_products = self.env['product.product'].search([]) + product_ids = tuple([pro_id.id for pro_id in category_products]) + sale_query = """ + SELECT sum(s_o_l.product_uom_qty) AS product_uom_qty, s_o_l.product_id FROM sale_order_line AS s_o_l + JOIN sale_order AS s_o ON s_o_l.order_id = s_o.id + WHERE s_o.state IN ('sale','done') + AND s_o.warehouse_id = %s + AND s_o_l.product_id in %s group by s_o_l.product_id""" + purchase_query = """ + SELECT sum(p_o_l.product_qty) AS product_qty, p_o_l.product_id FROM purchase_order_line AS p_o_l + JOIN purchase_order AS p_o ON p_o_l.order_id = p_o.id + INNER JOIN stock_picking_type AS s_p_t ON p_o.picking_type_id = s_p_t.id + WHERE p_o.state IN ('purchase','done') + AND s_p_t.warehouse_id = %s AND p_o_l.product_id in %s group by p_o_l.product_id""" + params = warehouse_ids, product_ids if product_ids else (0, 0) + self._cr.execute(sale_query, params) + self._cr.execute(purchase_query, params) + for rec in category_products: + sale_value = 0 + purchase_value = 0 + for sale_product in self._cr.dictfetchall(): + if sale_product['product_id'] == rec.id: + sale_value = sale_product['product_uom_qty'] + for purchase_product in self._cr.dictfetchall(): + if purchase_product['product_id'] == rec.id: + purchase_value = purchase_product['product_qty'] + virtual_available = rec.with_context( + {'warehouse': warehouse_ids}).virtual_available + outgoing_qty = rec.with_context( + {'warehouse': warehouse_ids}).outgoing_qty + incoming_qty = rec.with_context( + {'warehouse': warehouse_ids}).incoming_qty + available_qty = virtual_available + outgoing_qty - incoming_qty + vals = { + 'sku': rec.default_code, + 'name': rec.name, + 'category': rec.categ_id.name, + 'cost_price': rec.standard_price, + 'available': available_qty, + 'virtual': virtual_available, + 'incoming': incoming_qty, + 'outgoing': outgoing_qty, + 'net_on_hand': rec.with_context( + {'warehouse': warehouse_ids}).qty_available, + 'total_value': available_qty * rec.standard_price, + 'sale_value': sale_value, + 'purchase_value': purchase_value, + } + lines.append(vals) + return lines + + def get_xlsx_report(self, data, response): + """Function for designing an XLS report including warehouse and + category data.""" + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet('Stock Info') + format0 = workbook.add_format( + {'font_size': 20, 'align': 'center', 'bold': True}) + format1 = workbook.add_format( + {'font_size': 14, 'align': 'vcenter', 'bold': True}) + format11 = workbook.add_format( + {'font_size': 12, 'align': 'center', 'bold': True}) + format21 = workbook.add_format( + {'font_size': 10, 'align': 'center', 'bold': True}) + format3 = workbook.add_format( + {'bottom': True, 'top': True, 'font_size': 12}) + format4 = workbook.add_format( + {'font_size': 12, 'align': 'left', 'bold': True}) + font_size_8 = workbook.add_format({'font_size': 8, 'align': 'center'}) + font_size_8_l = workbook.add_format({'font_size': 8, 'align': 'left'}) + font_size_8_r = workbook.add_format({'font_size': 8, 'align': 'right'}) + red_mark = workbook.add_format({'font_size': 8, 'bg_color': 'red'}) + justify = workbook.add_format({'font_size': 12}) + format3.set_align('center') + justify.set_align('justify') + format1.set_align('center') + red_mark.set_align('center') + sheet.merge_range(1, 7, 2, 10, 'Product Stock Info', format0) + sheet.merge_range(3, 7, 3, 10, self.env.user.company_id.name, format11) + category_object = [] + if self.browse(data['ids']).category_ids.mapped('id'): + for res in self.browse(data['ids']).category_ids.mapped('id'): + category_object.append( + self.env['product.category'].browse(res).name) + category = ', '.join(category_object) + sheet.merge_range(4, 0, 4, 1, 'Category(s) : ', format4) + sheet.merge_range(4, 2, 4, 3 + len( + self.browse(data['ids']).category_ids.mapped('id')), category, + format4) + sheet.merge_range(5, 0, 5, 1, 'Warehouse(s) : ', format4) + ware_house = ', '.join(self.get_warehouse(self.browse(data['ids']))[0]) + sheet.merge_range(5, 2, 5, 3 + len( + self.get_warehouse(self.browse(data['ids']))[0]), ware_house, + format4) + user = self.env['res.users'].browse(self.env.uid) + tz = pytz.timezone(user.tz if user.tz else 'UTC') + times = pytz.utc.localize(datetime.datetime.now()).astimezone(tz) + sheet.merge_range('A8:G8', 'Report Date: ' + str( + times.strftime("%Y-%m-%d %H:%M %p")), format1) + sheet.merge_range(7, 7, 7, len( + self.get_warehouse(self.browse(data['ids']))[0]) * 11 + 6, + 'Warehouses', format1) + sheet.merge_range('A9:G9', 'Product Information', format11) + w_col_no = 6 + w_col_no1 = 7 + for record in self.get_warehouse(self.browse(data['ids']))[0]: + w_col_no = w_col_no + 11 + sheet.merge_range(8, w_col_no1, 8, w_col_no, record, format11) + w_col_no1 = w_col_no1 + 11 + sheet.write(9, 0, 'SKU', format21) + sheet.merge_range(9, 1, 9, 3, 'Name', format21) + sheet.merge_range(9, 4, 9, 5, 'Category', format21) + sheet.write(9, 6, 'Cost Price', format21) + p_col_no1 = 7 + for record in self.get_warehouse(self.browse(data['ids']))[0]: + w_col_no = w_col_no + 11 + sheet.merge_range(8, w_col_no1, 8, w_col_no, record, format11) + sheet.write(9, p_col_no1, 'Available', format21) + sheet.write(9, p_col_no1 + 1, 'Virtual', format21) + sheet.write(9, p_col_no1 + 2, 'Incoming', format21) + sheet.write(9, p_col_no1 + 3, 'Outgoing', format21) + sheet.merge_range(9, p_col_no1 + 4, 9, p_col_no1 + 5, 'Net On Hand', + format21) + sheet.merge_range(9, p_col_no1 + 6, 9, p_col_no1 + 7, 'Total Sold', + format21) + sheet.merge_range(9, p_col_no1 + 8, 9, p_col_no1 + 9, + 'Total Purchased', format21) + sheet.write(9, p_col_no1 + 10, 'Valuation', format21) + p_col_no1 = p_col_no1 + 11 + prod_row = 10 + prod_col = 0 + for record in self.get_warehouse(self.browse(data['ids']))[1]: + get_line = self.get_lines(self.browse(data['ids']).category_ids, + record) + for each in get_line: + sheet.write(prod_row, prod_col, each['sku'], font_size_8) + sheet.merge_range(prod_row, prod_col + 1, prod_row, + prod_col + 3, each['name'], font_size_8_l) + sheet.merge_range(prod_row, prod_col + 4, prod_row, + prod_col + 5, each['category'], font_size_8_l) + sheet.write(prod_row, prod_col + 6, each['cost_price'], + font_size_8_r) + prod_row = prod_row + 1 + break + prod_row = 10 + prod_col = 7 + for record in self.get_warehouse(self.browse(data['ids']))[1]: + get_line = self.get_lines(self.browse(data['ids']).category_ids, + record) + for each in get_line: + if each['available'] < 0: + sheet.write(prod_row, prod_col, each['available'], red_mark) + else: + sheet.write(prod_row, prod_col, each['available'], + font_size_8) + if each['virtual'] < 0: + sheet.write(prod_row, prod_col + 1, each['virtual'], + red_mark) + else: + sheet.write(prod_row, prod_col + 1, each['virtual'], + font_size_8) + if each['incoming'] < 0: + sheet.write(prod_row, prod_col + 2, each['incoming'], + red_mark) + else: + sheet.write(prod_row, prod_col + 2, each['incoming'], + font_size_8) + if each['outgoing'] < 0: + sheet.write(prod_row, prod_col + 3, each['outgoing'], + red_mark) + else: + sheet.write(prod_row, prod_col + 3, each['outgoing'], + font_size_8) + if each['net_on_hand'] < 0: + sheet.merge_range(prod_row, prod_col + 4, prod_row, + prod_col + 5, each['net_on_hand'], + red_mark) + else: + sheet.merge_range(prod_row, prod_col + 4, prod_row, + prod_col + 5, each['net_on_hand'], + font_size_8) + if each['sale_value'] < 0: + sheet.merge_range(prod_row, prod_col + 6, prod_row, + prod_col + 7, each['sale_value'], + red_mark) + else: + sheet.merge_range(prod_row, prod_col + 6, prod_row, + prod_col + 7, each['sale_value'], + font_size_8) + if each['purchase_value'] < 0: + sheet.merge_range(prod_row, prod_col + 8, prod_row, + prod_col + 9, each['purchase_value'], + red_mark) + else: + sheet.merge_range(prod_row, prod_col + 8, prod_row, + prod_col + 9, each['purchase_value'], + font_size_8) + if each['total_value'] < 0: + sheet.write(prod_row, prod_col + 10, each['total_value'], + red_mark) + else: + sheet.write(prod_row, prod_col + 10, each['total_value'], + font_size_8_r) + prod_row = prod_row + 1 + prod_row = 10 + prod_col = prod_col + 11 + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/export_stockinfo_xls/wizard/stock_report_views.xml b/export_stockinfo_xls/wizard/stock_report_views.xml new file mode 100644 index 000000000..93907796b --- /dev/null +++ b/export_stockinfo_xls/wizard/stock_report_views.xml @@ -0,0 +1,46 @@ + + + + + stock.xls.report.view.form + stock.xls.report + +
+ + + + + + + + + + + + +
+
+
+
+
+ + + Export product stock in Excel + stock.xls.report + ir.actions.act_window + form + + new + + + +