From 16fe2919cb034e95619f180bc8b0d1c0352043bc Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Fri, 17 Feb 2023 16:44:07 +0530 Subject: [PATCH] Feb 17 [UPDT] : Updated 'dynamic_accounts_report' --- dynamic_accounts_report/__manifest__.py | 2 +- dynamic_accounts_report/doc/RELEASE_NOTES.md | 8 +- .../models/account_account_custom.py | 2 - .../report/general_ledger.py | 1 - .../static/src/js/ageing.js | 6 - .../static/src/js/daybook.js | 1 - .../static/src/js/partner_ledger.js | 1 - .../static/src/xml/general_ledger_view.xml | 18 +- .../wizard/balance_sheet_config.py | 1 - inventory_report_generator/README.rst | 2 +- inventory_report_generator/__init__.py | 1 - inventory_report_generator/__manifest__.py | 5 +- .../controllers/__init__.py | 2 +- .../controllers/main.py | 12 +- .../doc/RELEASE_NOTES.md | 6 +- .../models/inventory_report.py | 72 ++-- .../report/inventory_pdf_report.py | 3 +- .../report/inventory_pdf_report.xml | 39 +- .../static/description/index.html | 399 +++++++++++------- .../static/src/css/inventory_report.css | 14 +- .../static/src/xml/inventory_report_view.xml | 251 ++++++----- 21 files changed, 464 insertions(+), 382 deletions(-) diff --git a/dynamic_accounts_report/__manifest__.py b/dynamic_accounts_report/__manifest__.py index 001206545..17aa7b477 100644 --- a/dynamic_accounts_report/__manifest__.py +++ b/dynamic_accounts_report/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Dynamic Financial Reports V16', - 'version': '16.0.1.0.1', + 'version': '16.0.1.0.2', 'category': 'Accounting', 'live_test_url': 'https://www.youtube.com/watch?v=gVQi9q9Rs-E&t=5s', 'summary': """Dynamic Financial Reports with drill diff --git a/dynamic_accounts_report/doc/RELEASE_NOTES.md b/dynamic_accounts_report/doc/RELEASE_NOTES.md index df17dc01c..291406f72 100644 --- a/dynamic_accounts_report/doc/RELEASE_NOTES.md +++ b/dynamic_accounts_report/doc/RELEASE_NOTES.md @@ -5,8 +5,12 @@ #### ADD - Initial commit for Odoo 16 dynamic financial reports - #### 01.02.2023 #### Version 16.0.1.0.1 #### UPDT -- css file updated +- CSS file updated + +#### 07.02.2023 +#### Version 16.0.1.0.2 +#### UPDT AND BUGFIX +- Report Bug Fix: Correct the currency used in the General Ledger diff --git a/dynamic_accounts_report/models/account_account_custom.py b/dynamic_accounts_report/models/account_account_custom.py index eb9325112..77c826135 100644 --- a/dynamic_accounts_report/models/account_account_custom.py +++ b/dynamic_accounts_report/models/account_account_custom.py @@ -52,7 +52,6 @@ class AccountAccountCustom(models.Model): [('type', '=', 'account_type')]): for rec in record.account_ids: if rec.id == self._origin.id: - print("function called") record.write({"account_ids": [(3, rec.id)]}) if self.account_type.startswith("asset"): for record1 in self.env[ @@ -64,7 +63,6 @@ class AccountAccountCustom(models.Model): {"account_ids": [(4, self._origin.id)]}) elif self.account_type.startswith( "liability") or self.account_type == "equity": - print('function_called...........') for record1 in self.env[ 'account.financial.report'].search( [('type', '=', 'account_type')]): diff --git a/dynamic_accounts_report/report/general_ledger.py b/dynamic_accounts_report/report/general_ledger.py index 25b6b70d5..912522d1c 100644 --- a/dynamic_accounts_report/report/general_ledger.py +++ b/dynamic_accounts_report/report/general_ledger.py @@ -6,7 +6,6 @@ class GeneralLedger(models.AbstractModel): @api.model def _get_report_values(self, docids, data=None): - if self.env.context.get('trial_pdf_report'): if data.get('report_data'): data.update({'account_data': data.get('report_data')['report_lines'], diff --git a/dynamic_accounts_report/static/src/js/ageing.js b/dynamic_accounts_report/static/src/js/ageing.js index 3a6cba960..740c5cd3c 100644 --- a/dynamic_accounts_report/static/src/js/ageing.js +++ b/dynamic_accounts_report/static/src/js/ageing.js @@ -260,11 +260,9 @@ odoo.define('dynamic_accounts_report.ageing', function (require) { var account_id = $(event.currentTarget).data('account-id'); var partner_id = $(event.currentTarget)[0].cells[0].innerText; - console.log("partner_id",partner_id) var offset = 0; var td = $(event.currentTarget).next('tr').find('td'); - console.log("td",td.length) if (td.length == 1) { self._rpc({ @@ -274,8 +272,6 @@ odoo.define('dynamic_accounts_report.ageing', function (require) { [self.wizard_id] ], }).then(function(data) { - console.log(data) - _.each(data['report_lines'][0], function(rep_lines) { _.each(rep_lines['child_lines'], function(child_line) { @@ -305,7 +301,6 @@ odoo.define('dynamic_accounts_report.ageing', function (require) { }, view_acc_move: function(event) { - console.log("view_acc_move") event.preventDefault(); var self = this; var context = {}; @@ -344,7 +339,6 @@ odoo.define('dynamic_accounts_report.ageing', function (require) { apply_filter: function(event) { - console.log("filter") event.preventDefault(); var self = this; self.initial_render = false; diff --git a/dynamic_accounts_report/static/src/js/daybook.js b/dynamic_accounts_report/static/src/js/daybook.js index 0fa11782b..d5a804636 100644 --- a/dynamic_accounts_report/static/src/js/daybook.js +++ b/dynamic_accounts_report/static/src/js/daybook.js @@ -90,7 +90,6 @@ odoo.define('dynamic_partner_daybook.daybook', function (require) { method: 'view_report', args: [[this.wizard_id]], }).then(function(datas) { - console.log("data",datas) _.each(datas['report_lines'], function(rep_lines) { rep_lines.debit = self.format_currency(datas['currency'],rep_lines.debit); rep_lines.credit = self.format_currency(datas['currency'],rep_lines.credit); diff --git a/dynamic_accounts_report/static/src/js/partner_ledger.js b/dynamic_accounts_report/static/src/js/partner_ledger.js index 02e74b39c..7caf7645f 100644 --- a/dynamic_accounts_report/static/src/js/partner_ledger.js +++ b/dynamic_accounts_report/static/src/js/partner_ledger.js @@ -381,7 +381,6 @@ odoo.define('dynamic_accounts_report.partner_ledger', function (require) { var account_type_ids_text = []; var span_res = document.getElementById("type_res") var type_list = $(".type").select2('data') - console.log(type_list) for (var i = 0; i < type_list.length; i++) { if(type_list[i].element[0].selected === true) {account_type_id.push(parseInt(type_list[i].id)) diff --git a/dynamic_accounts_report/static/src/xml/general_ledger_view.xml b/dynamic_accounts_report/static/src/xml/general_ledger_view.xml index 9ca9b8f79..b1dc547d6 100644 --- a/dynamic_accounts_report/static/src/xml/general_ledger_view.xml +++ b/dynamic_accounts_report/static/src/xml/general_ledger_view.xml @@ -415,7 +415,8 @@ - - + + @@ -425,7 +426,8 @@ - - + + @@ -437,7 +439,8 @@ - + + @@ -453,7 +456,8 @@ - + + @@ -463,7 +467,8 @@ - + + @@ -477,7 +482,8 @@ t-options='{"widget": "float", "precision": 2}'/> - + + diff --git a/dynamic_accounts_report/wizard/balance_sheet_config.py b/dynamic_accounts_report/wizard/balance_sheet_config.py index ec4ee71b8..8e0c5f07b 100644 --- a/dynamic_accounts_report/wizard/balance_sheet_config.py +++ b/dynamic_accounts_report/wizard/balance_sheet_config.py @@ -123,7 +123,6 @@ class BalanceSheet(models.TransientModel): # states = [report.account_type_ids] """end""" - print(report) accounts = self.env['account.account'].search([ ('account_type', 'in', report.account_ids.mapped('account_type')) diff --git a/inventory_report_generator/README.rst b/inventory_report_generator/README.rst index b80f56c7d..faa27e1bd 100644 --- a/inventory_report_generator/README.rst +++ b/inventory_report_generator/README.rst @@ -1,6 +1,6 @@ Inventory All In One Report Generator ===================================== -* Inventory All In One Dynamic Report For Odoo 15 community And Enterprise editions +* Inventory All In One Dynamic Report For Odoo 16 community And Enterprise editions Installation ============ diff --git a/inventory_report_generator/__init__.py b/inventory_report_generator/__init__.py index 4a84e60d7..ae81acf51 100644 --- a/inventory_report_generator/__init__.py +++ b/inventory_report_generator/__init__.py @@ -18,7 +18,6 @@ # If not, see . # ############################################################################# - from . import models from . import report from . import controllers diff --git a/inventory_report_generator/__manifest__.py b/inventory_report_generator/__manifest__.py index 40a587159..c58a1cb87 100644 --- a/inventory_report_generator/__manifest__.py +++ b/inventory_report_generator/__manifest__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Copyright (C) 2022-TODAY Cybrosys Technologies(). # # You can modify it under the terms of the GNU AFFERO # GENERAL PUBLIC LICENSE (AGPL v3), Version 3. @@ -12,7 +12,6 @@ # 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 . @@ -21,7 +20,7 @@ { 'name': 'Inventory All In One Report Generator', - 'version': '15.0.1.1.1', + 'version': '16.0.1.1.2', 'summary': "Dynamic Inventory Report Generator", 'description': "Dynamic Inventory Report Generator", 'category': 'Inventory', diff --git a/inventory_report_generator/controllers/__init__.py b/inventory_report_generator/controllers/__init__.py index 8edd0b2d2..38e203392 100644 --- a/inventory_report_generator/controllers/__init__.py +++ b/inventory_report_generator/controllers/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Copyright (C) 2022-TODAY Cybrosys Technologies(). # # You can modify it under the terms of the GNU AFFERO # GENERAL PUBLIC LICENSE (AGPL v3), Version 3. diff --git a/inventory_report_generator/controllers/main.py b/inventory_report_generator/controllers/main.py index d7dfb57b2..b83592258 100644 --- a/inventory_report_generator/controllers/main.py +++ b/inventory_report_generator/controllers/main.py @@ -26,8 +26,10 @@ from odoo.tools import html_escape class TBXLSXReportController(http.Controller): - @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): + @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): uid = request.session.uid report_obj = request.env[model].with_user(uid) dfr_data = dfr_data @@ -39,10 +41,12 @@ class TBXLSXReportController(http.Controller): None, headers=[ ('Content-Type', 'application/vnd.ms-excel'), - ('Content-Disposition', content_disposition(report_name + '.xlsx')) + ('Content-Disposition', + content_disposition(report_name + '.xlsx')) ] ) - report_obj.get_inventory_xlsx_report(options, response, report_data, dfr_data) + report_obj.get_inventory_xlsx_report(options, response, + report_data, dfr_data) response.set_cookie('fileToken', token) return response except Exception as e: diff --git a/inventory_report_generator/doc/RELEASE_NOTES.md b/inventory_report_generator/doc/RELEASE_NOTES.md index dbdbf56de..4aa8f021b 100644 --- a/inventory_report_generator/doc/RELEASE_NOTES.md +++ b/inventory_report_generator/doc/RELEASE_NOTES.md @@ -1,7 +1,7 @@ -## Module +## Module -#### 14.10.2022 -#### Version 16.0.1.0.0 +#### 16.02.2023 +#### Version 16.0.1.1.2 #### ADD Initial Commit diff --git a/inventory_report_generator/models/inventory_report.py b/inventory_report_generator/models/inventory_report.py index 66a52ca7b..8267a53b6 100644 --- a/inventory_report_generator/models/inventory_report.py +++ b/inventory_report_generator/models/inventory_report.py @@ -44,7 +44,6 @@ class DynamicInventoryReport(models.Model): @api.model def inventory_report(self, option): - # orders = self.env['purchase.order'].search([]) report_values = self.env['dynamic.inventory.report'].search( [('id', '=', option[0])]) data = { @@ -89,7 +88,8 @@ class DynamicInventoryReport(models.Model): return filters def get_filter_data(self, option): - r = self.env['dynamic.inventory.report'].search([('id', '=', option[0])]) + r = self.env['dynamic.inventory.report'].search( + [('id', '=', option[0])]) default_filters = {} filter_dict = { @@ -113,18 +113,19 @@ class DynamicInventoryReport(models.Model): new_filter = None 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 - ''' + 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') + 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') + 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) @@ -136,26 +137,26 @@ class DynamicInventoryReport(models.Model): LEFT OUTER JOIN ir_property prop_date ON prop_date.res_id = CONCAT('product.product,', product_product.id) left join product_category on product_category.id = product_template.categ_id ''' - term = 'Where ' + term = ' Where ' if data.get('date_from'): - query += "Where l.create_date >= '%s' " % data.get('date_from') - term = 'AND ' + query += " Where prop_date.create_date >= '%s' " % data.get('date_from') + term = ' AND ' if data.get('date_to'): - query += term + "l.create_date <= '%s' " % data.get('date_to') + query += term + " prop_date.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_location_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_location_route on stock_location_route.id = l.reception_route_id - ''' - term = 'Where ' + 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') + 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') @@ -163,14 +164,13 @@ class DynamicInventoryReport(models.Model): 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 ' + 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') + 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') @@ -312,10 +312,6 @@ class DynamicInventoryReport(models.Model): sheet.write('C7', 'Create Date', heading) sheet.write('D7', 'Product Cost', heading) sheet.write('E7', 'On Hand Qty', heading) - # sheet.write('F7', 'Product Name', heading) - # sheet.write('G7', 'Price unit', heading) - # sheet.write('H7', 'Qty', heading) - # sheet.write('I7', 'Price Total', heading) lst = [] for rec in report_data_main[0]: @@ -338,14 +334,10 @@ class DynamicInventoryReport(models.Model): two_lst = [] row += 1 sheet.write(row, col, rec_data['category'], txt_l) - sheet.write(row, col + 1, rec_data['name'], 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) sheet.write(row, col + 3, rec_data['value_float'], txt_l) sheet.write(row, col + 4, rec_data['quantity'], txt_l) - # sheet.write(row, col + 5, rec_data['product'], txt_l) - # sheet.write(row, col + 6, rec_data['price_unit'], txt_l) - # sheet.write(row, col + 7, rec_data['sum'], txt_l) - # sheet.write(row, col + 8, rec_data['amount_total'], txt_l) if filters.get('report_type') == 'report_by_warehouse': sheet.merge_range('B5:D5', 'Report Type: ' + @@ -376,7 +368,7 @@ class DynamicInventoryReport(models.Model): 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'], txt_l) + sheet.write(row, col + 4, rec_data['route']['en_US'], txt_l) if filters.get('report_type') == 'report_by_location': diff --git a/inventory_report_generator/report/inventory_pdf_report.py b/inventory_report_generator/report/inventory_pdf_report.py index 7d7ba9dad..28f0cb31b 100644 --- a/inventory_report_generator/report/inventory_pdf_report.py +++ b/inventory_report_generator/report/inventory_pdf_report.py @@ -30,7 +30,8 @@ class PurchaseOrder(models.AbstractModel): if self.env.context.get('inventory_pdf_report'): if data.get('report_data'): - data.update({'report_main_line_data': data.get('report_data')['report_lines'], + data.update({'report_main_line_data': data.get('report_data')[ + 'report_lines'], 'Filters': data.get('report_data')['filters'], 'company': self.env.company, }) diff --git a/inventory_report_generator/report/inventory_pdf_report.xml b/inventory_report_generator/report/inventory_pdf_report.xml index 4025813e4..6333d6c07 100644 --- a/inventory_report_generator/report/inventory_pdf_report.xml +++ b/inventory_report_generator/report/inventory_pdf_report.xml @@ -1,4 +1,13 @@ + + Inventory All In One Report + dynamic.inventory.report + qweb-pdf + inventory_report_generator.inventory_pdf_report + inventory_report_generator.inventory_pdf_report + report + + - - Inventory All In One Report - dynamic.inventory.report - qweb-pdf - inventory_report_generator.inventory_pdf_report - inventory_report_generator.inventory_pdf_report - \ No newline at end of file diff --git a/inventory_report_generator/static/description/index.html b/inventory_report_generator/static/description/index.html index c9b3288a3..3e9c9d4c0 100644 --- a/inventory_report_generator/static/description/index.html +++ b/inventory_report_generator/static/description/index.html @@ -1,19 +1,20 @@
- + style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;"> +
+ class="mr-2"> Community
+ class="mr-2"> Enterprise
+ class="mr-2"> Odoo.sh
@@ -21,66 +22,71 @@ -

Inventory All In One Report Generator

-

Dynamic Inventory Report Generator

+

+ Inventory All In One Report Generator

+

+ Dynamic Inventory Report Generator

+ style="width: 75%; height: auto; position: absolute; margin-left: auto; margin-right: auto; top: 45%; left: 12%; right: auto;"/>
-
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Explore This +

+ Explore This Module

@@ -88,84 +94,109 @@ -
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Overview +

+ Overview

-
+
- This app is useful to provide different Inventory Reports to do analysis. It shows the Inventory analysis of a company in many aspects such as by order,order details,salesman and so on. It can be filtered out based on different date ranges too. + This app is useful to provide different Inventory Reports to do + analysis. It shows the Inventory analysis of a company in many aspects + such as by order,order details,salesman and so on. It can be filtered + out based on different date ranges too.
-
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Features +

+ Features

-
+
-
- +
+ Community & Enterprise Support
-
- +
+ Filtering based on different aspects
-
- +
+ Drilled on approach
-
-
- - Print Reports in both PDF and XLSX format. -
-
- - +
+
+ + Print Reports in both PDF and XLSX format. +
+
+ + Generates Report for a specific date range. -
+
-
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Screenshots +

+ Screenshots

-

All In One Inventory Report Menu

+

+ All In One Inventory Report Menu

-

Inventory Report Based On Categories

+

+ Inventory Report Based On Categories

-

Inventory Report Based On Product

+

+ Inventory Report Based On Product

@@ -174,12 +205,15 @@ Generates Report for a specific date range. -
+
- + style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;"> +
-

Related +

+ Related Products

@@ -189,65 +223,89 @@ Generates Report for a specific date range.