diff --git a/inventory_report_generator/README.rst b/inventory_report_generator/README.rst new file mode 100644 index 000000000..7fef0b216 --- /dev/null +++ b/inventory_report_generator/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 + +Inventory All In One Report Generator +===================================== +* Inventory All In One Dynamic Report For Odoo 18 community And Enterprise editions + +Configuration +============= +* No additional configurations 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: (V17) Mruthul Raj, + (V18) Ranjith R, +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/inventory_report_generator/__init__.py b/inventory_report_generator/__init__.py new file mode 100644 index 000000000..1e964ccde --- /dev/null +++ b/inventory_report_generator/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +from . import controllers +from . import models +from . import report diff --git a/inventory_report_generator/__manifest__.py b/inventory_report_generator/__manifest__.py new file mode 100644 index 000000000..bd831d48b --- /dev/null +++ b/inventory_report_generator/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +{ + 'name': 'Inventory All In One Report Generator', + 'version': '18.0.1.0.0', + 'category': 'Productivity', + 'summary': "Dynamic Inventory Report Generator for Odoo 17", + 'description': "Streamline your inventory reporting with ease. Generate " + "dynamic reports, gain insights, and make informed " + "decisions.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['stock'], + 'data': [ + 'security/ir.model.access.csv', + 'views/inventory_report_views.xml', + 'report/inventory_pdf_report_templates.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'inventory_report_generator/static/src/js/inventory_report.js', + 'inventory_report_generator/static/src/css/inventory_report.css', + 'inventory_report_generator/static/src/xml/inventory_report_templates.xml', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/inventory_report_generator/controllers/__init__.py b/inventory_report_generator/controllers/__init__.py new file mode 100644 index 000000000..11e37d0b1 --- /dev/null +++ b/inventory_report_generator/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +from . import inventory_report_generator diff --git a/inventory_report_generator/controllers/inventory_report_generator.py b/inventory_report_generator/controllers/inventory_report_generator.py new file mode 100644 index 000000000..fc6434be6 --- /dev/null +++ b/inventory_report_generator/controllers/inventory_report_generator.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.tools import html_escape + + +class InventoryReportGenerator(http.Controller): + """Controller for handling dynamic inventory report exports in XLSX format. + This controller provides an HTTP endpoint for generating and exporting + dynamic inventory reports in XLSX format. It takes input options and + report data, creates an XLSX report, and sends it as an HTTP response.""" + + @http.route('/inventory_dynamic_xlsx_reports', type='http', auth='user', + methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, report_data, + report_name, dfr_data, **kw): + """Generate and export a dynamic inventory report in XLSX format. + This method handles the generation and export of dynamic inventory + reports in XLSX format. It takes various parameters like the report + model, export options, output format, and report data. + model: The report model for which the report is generated. + options: The export options and configuration. + output_format: The desired output format, such as 'xlsx'. + report_data: The data to be included in the report. + report_name: The name of the generated report file. + dfr_data: Additional data for report generation. + kw: Additional keyword arguments. + return: An HTTP response containing the generated XLSX report.""" + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + 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_inventory_xlsx_report(options, response, + report_data, dfr_data) + response.set_cookie('fileToken', token) + return response + except Exception as e: + se = http.serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': se + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/inventory_report_generator/doc/RELEASE_NOTES.md b/inventory_report_generator/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..70ecfb9e4 --- /dev/null +++ b/inventory_report_generator/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.01.2025 +#### Version 18.0.1.0.0 +#### ADD +- Initial Commit for Inventory All In One Report Generator diff --git a/inventory_report_generator/models/__init__.py b/inventory_report_generator/models/__init__.py new file mode 100644 index 000000000..f78e168da --- /dev/null +++ b/inventory_report_generator/models/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +from . import dynamic_inventory_report diff --git a/inventory_report_generator/models/dynamic_inventory_report.py b/inventory_report_generator/models/dynamic_inventory_report.py new file mode 100644 index 000000000..e713a310f --- /dev/null +++ b/inventory_report_generator/models/dynamic_inventory_report.py @@ -0,0 +1,430 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +import io +import json +from odoo import api, fields, models + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class DynamicInventoryReport(models.Model): + """Model for generating dynamic inventory reports. + This class represents a model for generating dynamic inventory reports + based on various criteria. It provides methods for creating, updating, + and generating reports with options like report type,date range, + and filters.""" + _name = "dynamic.inventory.report" + _description = "All in one inventory report" + + purchase_report = fields.Char(string="Inventory Report", + help="The name or title of the dynamic " + "inventory report.") + date_from = fields.Datetime(string="Date From", help="The starting date") + date_to = fields.Datetime(string="Date to", help="The ending date") + report_type = fields.Selection([ + ('report_by_transfers', 'Report By Transfers'), + ('report_by_categories', 'Report By Categories'), + ('report_by_warehouse', 'Report By Warehouse'), + ('report_by_location', 'Report By Location')], string="Report Type", + default='report_by_transfers', help="The type of dynamic inventory" + "report to generate.") + + @api.model + def inventory_report(self, option): + """Generate and return an inventory report. + Args: + option (list): A list containing the report options. + Returns: + dict: A dictionary containing report data.""" + report_values = self.env['dynamic.inventory.report'].search( + [('id', '=', option[0])]) + data = { + 'report_type': report_values.report_type, + 'model': self, + } + if report_values.date_from: + data.update({ + 'date_from': report_values.date_from, + }) + if report_values.date_to: + data.update({ + 'date_to': report_values.date_to, + }) + filters = self.get_filter(option) + self._get_report_values(data) + lines = self._get_report_values(data).get('INVENTORY') + return { + 'name': "Inventory Orders", + 'type': 'ir.actions.client', + 'tag': 's_r', + 'orders': data, + 'filters': filters, + 'report_lines': lines, + } + + def get_filter(self, option): + """Get filters for the inventory report. + Args: + option (list): A list containing the report options. + Returns: + dict: A dictionary containing filter data for the report.""" + data = self.get_filter_data(option) + filters = {} + if data.get('report_type') == 'report_by_transfers': + filters['report_type'] = 'Report By Transfers' + elif data.get('report_type') == 'report_by_categories': + filters['report_type'] = 'Report By Categories' + elif data.get('report_type') == 'report_by_warehouse': + filters['report_type'] = 'Report By Warehouse' + elif data.get('report_type') == 'report_by_location': + filters['report_type'] = 'Report By Location' + else: + filters['report_type'] = 'report_by_transfers' + return filters + + def get_filter_data(self, option): + """Get filter data for the inventory report. + Args: + option (list): A list containing the report options. + Returns: + dict: A dictionary containing filter data for the report.""" + r = self.env['dynamic.inventory.report'].search( + [('id', '=', option[0])]) + default_filters = {} + filter_dict = { + 'report_type': r.report_type, + } + filter_dict.update(default_filters) + return filter_dict + + @api.model + def create(self, vals): + """Create a new record of DynamicInventoryReport. + Args: + vals (dict): A dictionary of field values for the new record. + Returns: + DynamicInventoryReport: The created record.""" + res = super(DynamicInventoryReport, self).create(vals) + return res + + def write(self, vals): + """Update records of DynamicInventoryReport. + Args: + vals (dict): A dictionary of field values to update the records. + Returns: + bool: True if the records were successfully updated.""" + res = super(DynamicInventoryReport, self).write(vals) + return res + + def _get_report_sub_lines(self, data, report, date_from, date_to): + """Get sub-lines of the inventory report. + Args: + data (dict): Data for generating the report. + report (str): The type of report. + date_from (datetime): Start date for filtering. + date_to (datetime): End date for filtering. + Returns: + list: List of sub-lines for the inventory report.""" + report_sub_lines = [] + if data.get('report_type') == 'report_by_transfers': + query = '''select l.name,l.partner_id,l.scheduled_date,l.origin, + l.company_id,l.state,res_partner.name as partner, + res_company.name as company,l.id as id from stock_picking as l + left join res_partner on l.partner_id = res_partner.id left join + res_company on l.company_id = res_company.id''' + term = 'Where ' + if data.get('date_from'): + query += " Where l.scheduled_date >= '%s' " % data.get( + 'date_from') + term = 'AND ' + if data.get('date_to'): + query += term + " l.scheduled_date <= '%s' " % data.get( + 'date_to') + self._cr.execute(query) + report_by_order = self._cr.dictfetchall() + report_sub_lines.append(report_by_order) + elif data.get('report_type') == 'report_by_categories': + query = """ + select + product_product.standard_price as value_float, + product_template.name, + product_template.create_date, + product_template.categ_id, + product_product.id, + stock_quant.quantity, + product_category.name as category, + stock_location.complete_name as location + from + product_product + inner join + product_template on product_product.product_tmpl_id = + product_template.id + inner join + stock_quant on product_product.id = stock_quant.product_id + inner join + stock_location on stock_quant.location_id = stock_location.id + left join + product_category on product_category.id = + product_template.categ_id""" + term = ' Where ' + if data.get('date_from'): + query += " Where stock_quant.create_date >= '%s' " % data.get( + 'date_from') + term = ' AND ' + if data.get('date_to'): + query += term + " stock_quant.create_date <= '%s' " % data.get( + 'date_to') + self._cr.execute(query) + report_by_order_details = self._cr.dictfetchall() + report_sub_lines.append(report_by_order_details) + elif data.get('report_type') == 'report_by_warehouse': + query = '''select l.name,l.company_id,l.view_location_id, + l.reception_route_id as route,l.write_date,res_company.name as + company,stock_location.name as location,stock_route.name as + route from stock_warehouse as l left join res_company on + res_company.id = l.company_id left join stock_location on + stock_location.id = l.view_location_id left join stock_route on + stock_route.id = l.reception_route_id''' + term = ' Where ' + if data.get('date_from'): + query += " Where l.write_date >= '%s' " % data.get('date_from') + term = 'AND ' + if data.get('date_to'): + query += term + "l.write_date <= '%s' " % data.get('date_to') + self._cr.execute(query) + report_by_product = self._cr.dictfetchall() + report_sub_lines.append(report_by_product) + elif data.get('report_type') == 'report_by_location': + query = '''select l.complete_name,l.usage as location_type, + l.create_date,l.company_id,res_company.name as company from + stock_location as l left join res_company on res_company.id = + l.company_id''' + term = ' Where ' + if data.get('date_from'): + query += " Where l.create_date >= '%s' " % data.get('date_from') + term = 'AND ' + if data.get('date_to'): + query += term + "l.create_date <= '%s' " % data.get('date_to') + self._cr.execute(query) + report_by_categories = self._cr.dictfetchall() + report_sub_lines.append(report_by_categories) + return report_sub_lines + + def _get_report_total_value(self, data, report): + """Get the total value for the inventory report. + Args: + data (dict): Data for generating the report. + report (str): The type of report. + Returns: + list: List of total values for the inventory report.""" + report_main_lines = [] + if data.get('report_type') == 'report_by_order': + self._cr.execute(''' + select count(so.id) as order,sum(so.amount_total) as amount + from sale_order as so + ''') + report_by_order = self._cr.dictfetchall() + report_main_lines.append(report_by_order) + elif data.get('report_type') == 'report_by_order_detail': + self._cr.execute('''select count(so_line.id) as order, + sum(so_line.price_subtotal) as total from sale_order_line as so_line + ''') + report_by_order_detail = self._cr.dictfetchall() + report_main_lines.append(report_by_order_detail) + elif data.get('report_type') == 'report_by_product': + self._cr.execute(''' + select count(so_line.product_id) as order, + sum(so_line.price_subtotal) as amount from + sale_order_line as so_line ''') + report_by_product = self._cr.dictfetchall() + report_main_lines.append(report_by_product) + else: + report_main_lines = False + return report_main_lines + + def _get_report_values(self, data): + """Get the values for the inventory report. + Args: + data (dict): Data for generating the report. + Returns: + dict: Dictionary containing report data.""" + docs = data['model'] + date_from = data.get('date_from') + date_to = data.get('date_to') + if data['report_type'] == 'report_by_transfers': + report = ['Report By Transfers'] + elif data['report_type'] == 'report_by_categories': + report = ['Report By Categories'] + elif data['report_type'] == 'report_by_warehouse': + report = ['Report By Warehouse'] + elif data['report_type'] == 'report_by_location': + report = ['Report By Location'] + else: + report = ['report_by_transfers By Order'] + if data.get('report_type'): + report_res = \ + self._get_report_sub_lines(data, report, date_from, date_to)[0] + else: + report_res = self._get_report_sub_lines(data, report, date_from, + date_to) + return { + 'doc_ids': self.ids, + 'docs': docs, + 'INVENTORY': report_res, + } + + def get_inventory_xlsx_report(self, data, response, report_data, dfr_data): + """Generate an XLSX report for the inventory data. + Args: + data (str): JSON data for the report. + response (object): Response object for the XLSX report. + report_data (str): JSON data for the report. + dfr_data (str): JSON data for DynamicInventoryReport.""" + report_data_main = json.loads(report_data) + output = io.BytesIO() + filters = json.loads(data) + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + head = workbook.add_format({'align': 'center', 'bold': True, + 'font_size': '20px'}) + heading = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '10px', + 'border': 2, + 'border_color': 'black'}) + txt_l = workbook.add_format( + {'font_size': '10px', 'border': 1, 'bold': True}) + sheet.merge_range('A2:F3', 'Inventory Report', head) + if filters.get('report_type') == 'report_by_transfers': + sheet.merge_range('A5:D5', 'Report Type: ' + + filters.get('report_type'), txt_l) + sheet.write('A7', 'Reference', heading) + sheet.write('B7', 'Scheduled Date', heading) + sheet.write('C7', 'Source Document', heading) + sheet.write('D7', 'Company', heading) + sheet.write('E7', 'Delivery Address', heading) + sheet.write('F7', 'State', heading) + lst = [] + for rec in report_data_main[0]: + lst.append(rec) + row = 6 + col = 0 + sheet.set_column(3, 0, 15) + sheet.set_column(4, 1, 15) + sheet.set_column(5, 2, 15) + sheet.set_column(6, 3, 15) + sheet.set_column(7, 4, 15) + sheet.set_column(8, 5, 15) + for rec_data in report_data_main: + row += 1 + sheet.write(row, col, rec_data['name'], txt_l) + sheet.write(row, col + 1, rec_data['scheduled_date'], txt_l) + sheet.write(row, col + 2, rec_data['origin'], txt_l) + sheet.write(row, col + 3, rec_data['company'], txt_l) + sheet.write(row, col + 4, rec_data['partner'], txt_l) + sheet.write(row, col + 5, rec_data['state'], txt_l) + if filters.get('report_type') == 'report_by_categories': + sheet.merge_range('B5:D5', 'Report Type: ' + + filters.get('report_type'), txt_l) + sheet.write('A7', 'Category', heading) + sheet.write('B7', 'Product Name', heading) + sheet.write('C7', 'Create Date', heading) + sheet.write('D7', 'Product Cost', heading) + sheet.write('E7', 'Location', heading) + sheet.write('F7', 'On Hand Qty', heading) + lst = [] + for rec in report_data_main[0]: + lst.append(rec) + row = 6 + col = 0 + sheet.set_column(3, 0, 15) + sheet.set_column(4, 1, 15) + sheet.set_column(5, 2, 15) + sheet.set_column(6, 3, 15) + sheet.set_column(7, 4, 15) + sheet.set_column(8, 5, 15) + sheet.set_column(9, 6, 15) + sheet.set_column(10, 7, 15) + sheet.set_column(11, 8, 15) + sheet.set_column(12, 9, 15) + for rec_data in report_data_main: + row += 1 + sheet.write(row, col, rec_data['category'], txt_l) + sheet.write(row, col + 1, rec_data['name']['en_US'], txt_l) + sheet.write(row, col + 2, rec_data['create_date'], txt_l) + if rec_data['value_float']: + value = list(rec_data['value_float'].values())[0] + sheet.write(row, col + 3, value, txt_l) + sheet.write(row, col + 4, rec_data['location'], txt_l) + sheet.write(row, col + 5, rec_data['quantity'], txt_l) + if filters.get('report_type') == 'report_by_warehouse': + sheet.merge_range('B5:D5', 'Report Type: ' + + filters.get('report_type'), txt_l) + sheet.write('A7', 'Warehouse', heading) + sheet.write('B7', 'Date', heading) + sheet.write('C7', 'Company', heading) + sheet.write('D7', 'Location', heading) + sheet.write('E7', 'Route', heading) + lst = [] + for rec in report_data_main[0]: + lst.append(rec) + row = 6 + col = 0 + sheet.set_column(3, 0, 15) + sheet.set_column(4, 1, 15) + sheet.set_column(5, 2, 15) + sheet.set_column(6, 3, 15) + sheet.set_column(7, 4, 15) + for rec_data in report_data_main: + row += 1 + sheet.write(row, col, rec_data['name'], txt_l) + sheet.write(row, col + 1, rec_data['write_date'], txt_l) + sheet.write(row, col + 2, rec_data['company'], txt_l) + sheet.write(row, col + 3, rec_data['location'], txt_l) + sheet.write(row, col + 4, rec_data['route']['en_US'], txt_l) + if filters.get('report_type') == 'report_by_location': + sheet.merge_range('B5:D5', 'Report Type: ' + + filters.get('report_type'), txt_l) + sheet.write('B7', 'Location', heading) + sheet.write('C7', 'Location Type', heading) + sheet.write('D7', 'Create Date', heading) + sheet.write('E7', 'Company', heading) + lst = [] + for rec in report_data_main[0]: + lst.append(rec) + row = 6 + col = 1 + sheet.set_column(3, 1, 15) + sheet.set_column(4, 2, 15) + sheet.set_column(5, 3, 15) + sheet.set_column(6, 4, 15) + for rec_data in report_data_main: + row += 1 + sheet.write(row, col, rec_data['complete_name'], txt_l) + sheet.write(row, col + 1, rec_data['location_type'], txt_l) + sheet.write(row, col + 2, rec_data['create_date'], txt_l) + sheet.write(row, col + 3, rec_data['company'], txt_l) + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/inventory_report_generator/report/__init__.py b/inventory_report_generator/report/__init__.py new file mode 100644 index 000000000..3e28a0d77 --- /dev/null +++ b/inventory_report_generator/report/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +from . import inventory_pdf_report diff --git a/inventory_report_generator/report/inventory_pdf_report.py b/inventory_report_generator/report/inventory_pdf_report.py new file mode 100644 index 000000000..5ed5257f0 --- /dev/null +++ b/inventory_report_generator/report/inventory_pdf_report.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Ranjith R(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. + +############################################################################### +from odoo import api, models + + +class InventoryPDFReport(models.AbstractModel): + """This abstract model is used for generating an inventory PDF report. + This model serves as a template for generating PDF reports related + to inventory data. It is designed to be used as a base for specific + report generators.""" + _name = 'report.inventory_report_generator.inventory_pdf_report' + + @api.model + def _get_report_values(self, docids, data=None): + """Get report values for generating an inventory PDF report. + docids: IDs of the documents to be included in the report. + data: Additional data or options for generating the report. + return: A dictionary containing the report data and parameters.""" + if self.env.context.get('inventory_pdf_report'): + data.update({'report_main_line_data': data.get('report_data')[ + 'report_lines'], + 'Filters': data.get('report_data')['filters'], + 'Dates': data.get('report_data')['orders'], + 'company': self.env.company, + }) + return data diff --git a/inventory_report_generator/report/inventory_pdf_report_templates.xml b/inventory_report_generator/report/inventory_pdf_report_templates.xml new file mode 100644 index 000000000..8ad7b020c --- /dev/null +++ b/inventory_report_generator/report/inventory_pdf_report_templates.xml @@ -0,0 +1,281 @@ + + + + + Inventory All In One Report + dynamic.inventory.report + qweb-pdf + inventory_report_generator.inventory_pdf_report + inventory_report_generator.inventory_pdf_report + report + + + + + + + + + + + + diff --git a/inventory_report_generator/security/ir.model.access.csv b/inventory_report_generator/security/ir.model.access.csv new file mode 100644 index 000000000..12e303cf4 --- /dev/null +++ b/inventory_report_generator/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_dynamic_inventory_report_user,access.dynamic.inventory.report.user,model_dynamic_inventory_report,base.group_user,1,1,1,1 diff --git a/inventory_report_generator/static/description/assets/cybro-icon.png b/inventory_report_generator/static/description/assets/cybro-icon.png new file mode 100755 index 000000000..06e73e11d Binary files /dev/null and b/inventory_report_generator/static/description/assets/cybro-icon.png differ diff --git a/inventory_report_generator/static/description/assets/cybro-odoo.png b/inventory_report_generator/static/description/assets/cybro-odoo.png new file mode 100755 index 000000000..ed02e07a4 Binary files /dev/null and b/inventory_report_generator/static/description/assets/cybro-odoo.png differ diff --git a/inventory_report_generator/static/description/assets/h2.png b/inventory_report_generator/static/description/assets/h2.png new file mode 100755 index 000000000..0bfc4707d Binary files /dev/null and b/inventory_report_generator/static/description/assets/h2.png differ diff --git a/inventory_report_generator/static/description/assets/icons/arrows-repeat.svg b/inventory_report_generator/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-1.png b/inventory_report_generator/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/banner-1.png differ diff --git a/inventory_report_generator/static/description/assets/icons/banner-2.svg b/inventory_report_generator/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-bg.png b/inventory_report_generator/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/banner-bg.png differ diff --git a/inventory_report_generator/static/description/assets/icons/banner-bg.svg b/inventory_report_generator/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-call.svg b/inventory_report_generator/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-mail.svg b/inventory_report_generator/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-pattern.svg b/inventory_report_generator/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/banner-promo.svg b/inventory_report_generator/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/brand-pair.svg b/inventory_report_generator/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/check.png b/inventory_report_generator/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/check.png differ diff --git a/inventory_report_generator/static/description/assets/icons/chevron.png b/inventory_report_generator/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/chevron.png differ diff --git a/inventory_report_generator/static/description/assets/icons/close-icon.svg b/inventory_report_generator/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/cogs.png b/inventory_report_generator/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/cogs.png differ diff --git a/inventory_report_generator/static/description/assets/icons/collabarate-icon.svg b/inventory_report_generator/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/inventory_report_generator/static/description/assets/icons/consultation.png b/inventory_report_generator/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/consultation.png differ diff --git a/inventory_report_generator/static/description/assets/icons/cybro-logo.png b/inventory_report_generator/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/cybro-logo.png differ diff --git a/inventory_report_generator/static/description/assets/icons/down.svg b/inventory_report_generator/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/inventory_report_generator/static/description/assets/icons/ecom-black.png b/inventory_report_generator/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/ecom-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/education-black.png b/inventory_report_generator/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/education-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/faq.png b/inventory_report_generator/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/faq.png differ diff --git a/inventory_report_generator/static/description/assets/icons/feature-icon.svg b/inventory_report_generator/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/feature.png b/inventory_report_generator/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/feature.png differ diff --git a/inventory_report_generator/static/description/assets/icons/gear.svg b/inventory_report_generator/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/hero.gif b/inventory_report_generator/static/description/assets/icons/hero.gif new file mode 100755 index 000000000..380654dfe Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/hero.gif differ diff --git a/inventory_report_generator/static/description/assets/icons/hire-odoo.svg b/inventory_report_generator/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/hotel-black.png b/inventory_report_generator/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/hotel-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/license.png b/inventory_report_generator/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/license.png differ diff --git a/inventory_report_generator/static/description/assets/icons/life-ring-icon.svg b/inventory_report_generator/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/lifebuoy.png b/inventory_report_generator/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/lifebuoy.png differ diff --git a/inventory_report_generator/static/description/assets/icons/mail.svg b/inventory_report_generator/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/inventory_report_generator/static/description/assets/icons/manufacturing-black.png b/inventory_report_generator/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/manufacturing-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/notes.png b/inventory_report_generator/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/notes.png differ diff --git a/inventory_report_generator/static/description/assets/icons/notification icon.svg b/inventory_report_generator/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/odoo-consultancy.svg b/inventory_report_generator/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/inventory_report_generator/static/description/assets/icons/odoo-licencing.svg b/inventory_report_generator/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/inventory_report_generator/static/description/assets/icons/odoo-logo.png b/inventory_report_generator/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/odoo-logo.png differ diff --git a/inventory_report_generator/static/description/assets/icons/patter.svg b/inventory_report_generator/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/pattern1.png b/inventory_report_generator/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/pattern1.png differ diff --git a/inventory_report_generator/static/description/assets/icons/pos-black.png b/inventory_report_generator/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/pos-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/puzzle-piece-icon.svg b/inventory_report_generator/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/puzzle.png b/inventory_report_generator/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/puzzle.png differ diff --git a/inventory_report_generator/static/description/assets/icons/replace-icon.svg b/inventory_report_generator/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/restaurant-black.png b/inventory_report_generator/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/restaurant-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/screenshot-main.png b/inventory_report_generator/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/screenshot-main.png differ diff --git a/inventory_report_generator/static/description/assets/icons/screenshot.png b/inventory_report_generator/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/screenshot.png differ diff --git a/inventory_report_generator/static/description/assets/icons/service-black.png b/inventory_report_generator/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/service-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/skype-fill.svg b/inventory_report_generator/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/skype.png b/inventory_report_generator/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/skype.png differ diff --git a/inventory_report_generator/static/description/assets/icons/skype.svg b/inventory_report_generator/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/inventory_report_generator/static/description/assets/icons/star-1.svg b/inventory_report_generator/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/star-2.svg b/inventory_report_generator/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/support.png b/inventory_report_generator/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/support.png differ diff --git a/inventory_report_generator/static/description/assets/icons/test-1 - Copy.png b/inventory_report_generator/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/test-1 - Copy.png differ diff --git a/inventory_report_generator/static/description/assets/icons/test-1.png b/inventory_report_generator/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/test-1.png differ diff --git a/inventory_report_generator/static/description/assets/icons/test-2.png b/inventory_report_generator/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/test-2.png differ diff --git a/inventory_report_generator/static/description/assets/icons/trading-black.png b/inventory_report_generator/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/trading-black.png differ diff --git a/inventory_report_generator/static/description/assets/icons/training.png b/inventory_report_generator/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/training.png differ diff --git a/inventory_report_generator/static/description/assets/icons/translate.svg b/inventory_report_generator/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/update.png b/inventory_report_generator/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/update.png differ diff --git a/inventory_report_generator/static/description/assets/icons/user.png b/inventory_report_generator/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/user.png differ diff --git a/inventory_report_generator/static/description/assets/icons/video.png b/inventory_report_generator/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/video.png differ diff --git a/inventory_report_generator/static/description/assets/icons/whatsapp.png b/inventory_report_generator/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/whatsapp.png differ diff --git a/inventory_report_generator/static/description/assets/icons/wrench-icon.svg b/inventory_report_generator/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/inventory_report_generator/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/inventory_report_generator/static/description/assets/icons/wrench.png b/inventory_report_generator/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/inventory_report_generator/static/description/assets/icons/wrench.png differ diff --git a/inventory_report_generator/static/description/assets/modules/1.jpg b/inventory_report_generator/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/1.jpg differ diff --git a/inventory_report_generator/static/description/assets/modules/2.jpg b/inventory_report_generator/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/2.jpg differ diff --git a/inventory_report_generator/static/description/assets/modules/3.jpg b/inventory_report_generator/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/3.jpg differ diff --git a/inventory_report_generator/static/description/assets/modules/4.png b/inventory_report_generator/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/4.png differ diff --git a/inventory_report_generator/static/description/assets/modules/5.jpg b/inventory_report_generator/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/5.jpg differ diff --git a/inventory_report_generator/static/description/assets/modules/6.gif b/inventory_report_generator/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/inventory_report_generator/static/description/assets/modules/6.gif differ diff --git a/inventory_report_generator/static/description/assets/screenshots/1.png b/inventory_report_generator/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..f831809fd Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/1.png differ diff --git a/inventory_report_generator/static/description/assets/screenshots/2.png b/inventory_report_generator/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..9aebe7c40 Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/2.png differ diff --git a/inventory_report_generator/static/description/assets/screenshots/3.png b/inventory_report_generator/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..e53b34a09 Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/3.png differ diff --git a/inventory_report_generator/static/description/assets/screenshots/4.png b/inventory_report_generator/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..75946a61e Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/4.png differ diff --git a/inventory_report_generator/static/description/assets/screenshots/5.png b/inventory_report_generator/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..3f134b151 Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/5.png differ diff --git a/inventory_report_generator/static/description/assets/screenshots/hero.gif b/inventory_report_generator/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..86c13f97a Binary files /dev/null and b/inventory_report_generator/static/description/assets/screenshots/hero.gif differ diff --git a/inventory_report_generator/static/description/assets/y18.jpg b/inventory_report_generator/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/inventory_report_generator/static/description/assets/y18.jpg differ diff --git a/inventory_report_generator/static/description/banner.jpg b/inventory_report_generator/static/description/banner.jpg new file mode 100644 index 000000000..1623d9406 Binary files /dev/null and b/inventory_report_generator/static/description/banner.jpg differ diff --git a/inventory_report_generator/static/description/icon.png b/inventory_report_generator/static/description/icon.png new file mode 100644 index 000000000..9bb152c99 Binary files /dev/null and b/inventory_report_generator/static/description/icon.png differ diff --git a/inventory_report_generator/static/description/index.html b/inventory_report_generator/static/description/index.html new file mode 100644 index 000000000..bd0366d2b --- /dev/null +++ b/inventory_report_generator/static/description/index.html @@ -0,0 +1,975 @@ + + + + + + Inventory All In One Report Generator + + + + + + + + + + +
+
+ + + +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ Get Dynamic Inventory Report. +

+

Inventory All In One Report Generator +

+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+ This app helps to print report of inventory on multiple condition. +
+
+
+
+ +
+
+
+

Key + Highlights

+
+
+
+
+ +
+
+ printing report you will get view in backend + odoo. +
+
+
+
+
+
+ +
+
+ Print XLSX and PDF:Print the + required report in pdf or excel format.
+
+
+
+
+ +
+
+
+ Inventory All In One Report Generator +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ All In One Inventory Report Menu. + +

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

+ Inventory Report Based On Product Categories. +

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

+ + Inventory Report Based On Location. + +

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

+ +Inventory Report Based On Transfers. + +

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

+ +Inventory Report Based On Location. +

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

+printing report you will get view in backend + odoo. +

+
+
+
+
+
+
+
+ +
+

+Print XLSX and PDF:Print the + required report in pdf or excel format.

+
+
+
+
+
+
+
+
+

+ Frequently Asked Questions (FAQ) +

+
+
+
+ + +
+

+ +

+
+
+ This module helps generate detailed inventory reports based on product categories, locations, and transfers, with support for PDF and Excel formats. +
+
+
+ + +
+

+ +

+
+
+ Yes, the module supports exporting reports to both PDF and Excel (XLSX) formats for easy sharing and analysis. +
+
+
+ + +
+

+ +

+
+
+ Inventory reports can be accessed through the backend dashboard under the 'Inventory Reports' menu. +
+
+
+ + +
+

+ +

+
+
+ This module is designed for Odoo version 17.0. Please ensure you are using the correct version to avoid compatibility issues. +
+
+
+ +
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 13th January, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • Initial Commit for + Inventory All In One Report Generator +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+
+ +
+
+ .... +
+
+ +
+
+ +
+
+ + + + + + diff --git a/inventory_report_generator/static/src/css/inventory_report.css b/inventory_report_generator/static/src/css/inventory_report.css new file mode 100644 index 000000000..02e87c3f7 --- /dev/null +++ b/inventory_report_generator/static/src/css/inventory_report.css @@ -0,0 +1,57 @@ +.time_range_pr { + width: 125px; + border: 2px solid #ccc; + border-radius: 5px; + padding: 10px; +} +.apply_sale{ + margin-right: 5px; + padding: 4px; +} +a.dropdown-toggle.report-type { + margin: 10px; +} +.search { + border: 2px solid #ccc; + width: 257px; + margin-right: 10px; + margin-left: 10px; + border-radius: 5px; +} +.table_pr_head { + background-color: #7c7bad; + color: #fff; + padding: 20px; + margin: 20px; + height: 57px; + width: 100%; + border: 1px solid #000; +} +element.style { + top: 0px; + height: 42px; + color: white; + background-color: #7c7bad; + border-color: #7c7bad; + width: 100px; +} +tr.pr-line { + height: 48px; +} +tr.table_pr_head th { + font-size: 18px; + text-align: center; +} +.btn-secondary { + color: #000000; + background-color: #FFFFFF; + border-color: #FFFFFF; + color: #66598f; + PADDING: 0PX; +} +.table_view_pr { + overflow-y: scroll; + position: relative; + height: 800px; + max-width: 100%; +} diff --git a/inventory_report_generator/static/src/js/inventory_report.js b/inventory_report_generator/static/src/js/inventory_report.js new file mode 100644 index 000000000..9ea1e9f2c --- /dev/null +++ b/inventory_report_generator/static/src/js/inventory_report.js @@ -0,0 +1,204 @@ +/** @odoo-module */ +import { registry} from '@web/core/registry'; +import { useService } from "@web/core/utils/hooks"; +const { Component,useRef, onWillStart,onMounted} = owl +import { rpc } from "@web/core/network/rpc"; +import { _t } from "@web/core/l10n/translation"; +import { renderToElement } from "@web/core/utils/render"; +import { BlockUI } from "@web/core/ui/block_ui"; +import { download } from "@web/core/network/download"; + +export class InventoryReport extends Component { + /** + * Initializes the InventoryReport component. + */ + setup() { + this.action = useService("action"); + self.initial_render = false; + this.table_view_pr = useRef('table_view_pr'); + this.date_from = useRef('date_from'); + this.date_to = useRef('date_to'); + this.report_type = useRef('report_type'); + this.report_res = useRef('report_res'); + this.dates = useRef('dates'); + onMounted(async () => { + var self = this; + self.initial_render = true; + await rpc('/web/dataset/call_kw/dynamic.inventory.report/create', { + model: 'dynamic.inventory.report', + method: 'create', + args: [{}], + kwargs: {}, + }).then(async function(res) { + self.wizard_id = res; + await self.load_data(self.initial_render); + self.apply_filter(); + }) + }); + } + /** + * Loads data for the report. + * + * @param {boolean} initial_render - Indicates if it's the initial render. + */ + async load_data(initial_render = true) { + var self = this; + await rpc('/web/dataset/call_kw/dynamic.inventory.report/inventory_report', { + model: 'dynamic.inventory.report', + method: 'inventory_report', + args: [ + [this.wizard_id] + ], + kwargs: {}, + }).then(function(datas) { + if (datas['orders'] ) { + self.table_view_pr.el.innerHTML = ''; + self.table_view_pr.el.append(renderToElement('InventoryReportTable', { + filter: datas['filters'], + order: datas['orders'], + report_lines: datas['report_lines'], + main_lines: datas['report_main_line'], + this: self, + })) + } + }) + } + /** + * Applies filters to the report. + */ + apply_filter() { + var self = this; + self.initial_render = false; + var filter_data_selected = {}; + + function setFilterValue(selector, key, target) { + var value =selector.el.value; + if (value) { + filter_data_selected[key] = value; + target.el.innerHTML = value; + } + } + setFilterValue(self.date_from, 'date_from', this.dates); + setFilterValue(self.date_to, 'date_to', this.dates); + if (filter_data_selected.date_from && filter_data_selected.date_to) { + self.dates.el.innerHTML = filter_data_selected.date_from + " to " + filter_data_selected.date_to; + } + if (self.report_type) { + var report_res = self.report_res; + filter_data_selected.report_type = self.report_type.el.value; + report_res.el.innerHTML = self.report_type.el.options[self.report_type.el.selectedIndex].text || "report_by_order"; + } + rpc('/web/dataset/call_kw/dynamic.inventory.report/write', { + model: 'dynamic.inventory.report', + method: 'write', + args: [self.wizard_id, filter_data_selected], + kwargs: {}, + }).then(function(res) { + self.initial_render = false; + self.load_data(self.initial_render); + }); + } + /** + * Prints the report as a PDF. + * + * @param {Event} e - The event object. + */ + print_pdf(e) { + e.preventDefault(); + var self = this; + var action_title = self._title; + rpc('/web/dataset/call_kw/dynamic.inventory.report/inventory_report', { + model: 'dynamic.inventory.report', + method: 'inventory_report', + args: [ + [self.wizard_id] + ], + kwargs: {}, + }).then(function(data) { + var action = { + 'type': 'ir.actions.report', + 'report_type': 'qweb-pdf', + 'report_name': 'inventory_report_generator.inventory_pdf_report', + 'report_file': 'inventory_report_generator.inventory_pdf_report', + 'data': { + 'report_data': data + }, + 'context': { + 'active_model': 'inventory.report', + 'landscape': 1, + 'inventory_pdf_report': true + }, + 'display_name': 'Inventory Report', + }; + return self.action.doAction(action); + }); + } + /** + * Opens a view for a specific order. + * + * @param {Event} ev - The event object. + */ + button_view_order(ev) { + ev.preventDefault(); + var self = this; + var context = {}; + this.action.doAction({ + name: _t("Transfer Order"), + type: 'ir.actions.act_window', + res_model: 'stock.picking', + view_type: 'form', + domain: [ + ['id', '=', ev.target.id] + ], + views: [ + [false, 'list'], + [false, 'form'] + ], + target: 'current' + }); + } + /** + * Exports the report data as an XLSX file. + */ + print_xlsx() { + var self = this; + rpc('/web/dataset/call_kw/dynamic.inventory.report/inventory_report', { + model: 'dynamic.inventory.report', + method: 'inventory_report', + args: [ + [self.wizard_id] + ], + kwargs: {}, + }).then(function(data) { + var action = { + 'data': { + 'model': 'dynamic.inventory.report', + 'options': JSON.stringify(data['orders']), + 'output_format': 'xlsx', + 'report_data': JSON.stringify(data['report_lines']), + 'report_name': 'Inventory Report', + 'dfr_data': JSON.stringify(data), + }, + }; + self.downloadXlsx(action); + }); + } + /** + * Downloads the XLSX report. + * + * @param {Object} action - The action data for downloading. + */ + async downloadXlsx(action) { + if (action['data']['output_format']) { + BlockUI; + await download({ + url: '/inventory_dynamic_xlsx_reports', + data: action.data, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + } + } +} +InventoryReport.template = "InventoryReport" +registry.category("actions").add("inv_r", InventoryReport) diff --git a/inventory_report_generator/static/src/xml/inventory_report_templates.xml b/inventory_report_generator/static/src/xml/inventory_report_templates.xml new file mode 100644 index 000000000..26016459e --- /dev/null +++ b/inventory_report_generator/static/src/xml/inventory_report_templates.xml @@ -0,0 +1,364 @@ + + + + +
+
+
+

Inventory Report

+
+
+
+
+ +
+
+
+
+
+
+ + + +
+
+
+ + +
+
+
+ + +
+ +
+
+ +
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
ReferenceScheduled DateSource DocumentCompanyDelivery AddressState
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
CategoryProduct Name + Create Date +
+

( Product creation date ) +

+
Product CostLocationOn Hand Qty
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
WarehouseDateCompanyLocationRoute
+ + + +
+ +
+
+ + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
LocationLocation TypeCreate DateCompany
+ + + + + + + + + + + + + + + + +
+
+
+
+ diff --git a/inventory_report_generator/views/inventory_report_views.xml b/inventory_report_generator/views/inventory_report_views.xml new file mode 100644 index 000000000..532133e26 --- /dev/null +++ b/inventory_report_generator/views/inventory_report_views.xml @@ -0,0 +1,13 @@ + + + + + All In One Inventory Report + inv_r + + + +