From 444049320b8e2411a0cf688f61adfa999a792b00 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 17:13:41 +0700 Subject: initial commit --- addons/account_reports_xlsx/README.rst | 19 + addons/account_reports_xlsx/__init__.py | 26 ++ addons/account_reports_xlsx/__manifest__.py | 53 +++ .../account_reports_xlsx/controllers/__init__.py | 23 ++ addons/account_reports_xlsx/controllers/main.py | 56 +++ addons/account_reports_xlsx/doc/RELEASE_NOTES.md | 6 + addons/account_reports_xlsx/models/__init__.py | 26 ++ .../models/account_aged_partner_balance.py | 266 ++++++++++++++ .../models/account_financial_report.py | 91 +++++ .../models/account_general_ledger.py | 156 ++++++++ .../models/account_partner_ledger.py | 151 ++++++++ addons/account_reports_xlsx/report/__init__.py | 1 + .../report/account_aged_partner_balance.py | 261 +++++++++++++ .../security/ir.model.access.csv | 7 + .../static/description/banner.png | Bin 0 -> 49617 bytes .../static/description/icon.png | Bin 0 -> 15233 bytes .../images/Accounting Reports in Excel.png | Bin 0 -> 118352 bytes .../static/description/images/account_Report_2.png | Bin 0 -> 45909 bytes .../static/description/images/account_report.png | Bin 0 -> 35854 bytes .../static/description/images/account_report_3.png | Bin 0 -> 39464 bytes .../static/description/images/account_report_6.png | Bin 0 -> 47052 bytes .../static/description/images/account_report_7.png | Bin 0 -> 28114 bytes .../static/description/images/account_report_8.png | Bin 0 -> 55753 bytes .../static/description/images/account_report_9.png | Bin 0 -> 37960 bytes .../description/images/accounting-report.gif | Bin 0 -> 3921987 bytes .../description/images/accounting_report_4.png | Bin 0 -> 99203 bytes .../description/images/accounting_report_5.png | Bin 0 -> 37366 bytes .../static/description/images/bank_book.png | Bin 0 -> 114348 bytes .../static/description/images/banner.png | Bin 0 -> 127361 bytes .../static/description/images/cash_book.jpeg | Bin 0 -> 148633 bytes .../static/description/images/checked.png | Bin 0 -> 15093 bytes .../static/description/images/cybrosys.png | Bin 0 -> 52522 bytes .../static/description/images/day_book_report.png | Bin 0 -> 135936 bytes .../images/dynamic_financial_report.png | Bin 0 -> 114408 bytes .../description/images/full_accounting_kit.gif | Bin 0 -> 266897 bytes .../static/description/images/project_report.png | Bin 0 -> 92918 bytes .../static/description/index.html | 402 +++++++++++++++++++++ .../static/src/js/action_manager.js | 52 +++ .../views/account_financial_report_data.xml | 71 ++++ .../account_reports_xlsx/views/action_manager.xml | 9 + .../views/financial_report_wizard_view.xml | 16 + .../views/financial_report_xls_view.xml | 15 + .../views/general_ledger_report_view.xml | 15 + .../views/general_ledger_report_wizard_view.xml | 15 + .../views/partner_ledgerreport.xml | 96 +++++ addons/account_reports_xlsx/views/report.xml | 17 + .../views/report_agedpartnerbalance.xml | 95 +++++ .../views/supplier_aging_report_view.xml | 85 +++++ addons/account_reports_xlsx/wizard/__init__.py | 27 ++ .../wizard/account_financial_report.py | 245 +++++++++++++ .../wizard/account_financial_report_view.xml | 63 ++++ .../wizard/account_report_aged_partner_balance.py | 209 +++++++++++ .../account_report_aged_partner_balance_view.xml | 42 +++ .../wizard/account_report_financial.py | 181 ++++++++++ .../wizard/account_report_general_ledger.py | 240 ++++++++++++ .../wizard/account_report_general_ledger_view.xml | 39 ++ .../wizard/account_report_partner_ledger.py | 265 ++++++++++++++ .../wizard/partner_ledger_wizard_view.xml | 63 ++++ addons/banner_sale/__init__.py | 1 + addons/banner_sale/__manifest__.py | 22 ++ addons/banner_sale/models/__init__.py | 4 + addons/banner_sale/models/banner.py | 16 + addons/banner_sale/models/banner_category.py | 11 + addons/banner_sale/models/coupon_program.py | 10 + addons/banner_sale/models/product_brand.py | 10 + addons/banner_sale/security/ir.model.access.csv | 3 + addons/banner_sale/views/banner.xml | 61 ++++ addons/banner_sale/views/banner_category.xml | 53 +++ addons/banner_sale/views/product_brand.xml | 26 ++ addons/mail_reply_to_sender/__init__.py | 3 + addons/mail_reply_to_sender/__manifest__.py | 22 ++ addons/mail_reply_to_sender/models/__init__.py | 2 + .../mail_reply_to_sender/models/ir_mail_server.py | 16 + .../static/description/banner.png | Bin 0 -> 232656 bytes .../static/description/icon.png | Bin 0 -> 46313 bytes .../static/description/index.html | 87 +++++ .../static/description/mail_reply_to_1.png | Bin 0 -> 59383 bytes .../static/description/mail_reply_to_2.png | Bin 0 -> 47181 bytes .../description/ppts/odoo-erp-customization.svg | 1 + .../description/ppts/odoo-erp-implementation.svg | 1 + .../description/ppts/odoo-erp-integration.svg | 1 + .../static/description/ppts/odoo-erp-migration.svg | 1 + .../static/description/ppts/odoo-erp-support.svg | 1 + .../static/description/reply_to.png | Bin 0 -> 27416 bytes addons/product_brand_sale/README.md | 32 ++ addons/product_brand_sale/__init__.py | 1 + addons/product_brand_sale/__manifest__.py | 41 +++ addons/product_brand_sale/doc/RELEASE_NOTES.md | 6 + addons/product_brand_sale/models/__init__.py | 1 + addons/product_brand_sale/models/brand.py | 36 ++ .../security/ir.model.access.csv | 2 + .../static/description/banner.png | Bin 0 -> 82897 bytes .../product_brand_sale/static/description/icon.png | Bin 0 -> 20776 bytes .../static/description/images/1.jpeg | Bin 0 -> 72086 bytes .../static/description/images/2.jpeg | Bin 0 -> 86978 bytes .../static/description/images/3.jpeg | Bin 0 -> 67289 bytes .../static/description/images/4.jpeg | Bin 0 -> 65042 bytes .../static/description/images/5.jpeg | Bin 0 -> 154945 bytes .../static/description/images/6.jpeg | Bin 0 -> 141285 bytes .../static/description/images/checked.png | Bin 0 -> 15093 bytes .../static/description/images/cybrosys.png | Bin 0 -> 52522 bytes .../static/description/images/productbrand1.png | Bin 0 -> 263911 bytes .../static/description/images/productbrand2.png | Bin 0 -> 38326 bytes .../static/description/images/productbrand3.png | Bin 0 -> 80188 bytes .../static/description/images/productbrand4.png | Bin 0 -> 288265 bytes .../static/description/images/productbrand5.png | Bin 0 -> 234664 bytes .../static/description/images/productbrand6.png | Bin 0 -> 68786 bytes .../static/description/images/productbrand7.png | Bin 0 -> 56021 bytes .../static/description/index.html | 327 +++++++++++++++++ addons/product_brand_sale/views/brand_views.xml | 108 ++++++ 110 files changed, 4310 insertions(+) create mode 100755 addons/account_reports_xlsx/README.rst create mode 100755 addons/account_reports_xlsx/__init__.py create mode 100755 addons/account_reports_xlsx/__manifest__.py create mode 100755 addons/account_reports_xlsx/controllers/__init__.py create mode 100755 addons/account_reports_xlsx/controllers/main.py create mode 100755 addons/account_reports_xlsx/doc/RELEASE_NOTES.md create mode 100755 addons/account_reports_xlsx/models/__init__.py create mode 100755 addons/account_reports_xlsx/models/account_aged_partner_balance.py create mode 100755 addons/account_reports_xlsx/models/account_financial_report.py create mode 100755 addons/account_reports_xlsx/models/account_general_ledger.py create mode 100755 addons/account_reports_xlsx/models/account_partner_ledger.py create mode 100755 addons/account_reports_xlsx/report/__init__.py create mode 100755 addons/account_reports_xlsx/report/account_aged_partner_balance.py create mode 100755 addons/account_reports_xlsx/security/ir.model.access.csv create mode 100755 addons/account_reports_xlsx/static/description/banner.png create mode 100755 addons/account_reports_xlsx/static/description/icon.png create mode 100755 addons/account_reports_xlsx/static/description/images/Accounting Reports in Excel.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_Report_2.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report_3.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report_6.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report_7.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report_8.png create mode 100755 addons/account_reports_xlsx/static/description/images/account_report_9.png create mode 100755 addons/account_reports_xlsx/static/description/images/accounting-report.gif create mode 100755 addons/account_reports_xlsx/static/description/images/accounting_report_4.png create mode 100755 addons/account_reports_xlsx/static/description/images/accounting_report_5.png create mode 100755 addons/account_reports_xlsx/static/description/images/bank_book.png create mode 100755 addons/account_reports_xlsx/static/description/images/banner.png create mode 100755 addons/account_reports_xlsx/static/description/images/cash_book.jpeg create mode 100755 addons/account_reports_xlsx/static/description/images/checked.png create mode 100755 addons/account_reports_xlsx/static/description/images/cybrosys.png create mode 100755 addons/account_reports_xlsx/static/description/images/day_book_report.png create mode 100755 addons/account_reports_xlsx/static/description/images/dynamic_financial_report.png create mode 100755 addons/account_reports_xlsx/static/description/images/full_accounting_kit.gif create mode 100755 addons/account_reports_xlsx/static/description/images/project_report.png create mode 100755 addons/account_reports_xlsx/static/description/index.html create mode 100755 addons/account_reports_xlsx/static/src/js/action_manager.js create mode 100755 addons/account_reports_xlsx/views/account_financial_report_data.xml create mode 100755 addons/account_reports_xlsx/views/action_manager.xml create mode 100755 addons/account_reports_xlsx/views/financial_report_wizard_view.xml create mode 100755 addons/account_reports_xlsx/views/financial_report_xls_view.xml create mode 100755 addons/account_reports_xlsx/views/general_ledger_report_view.xml create mode 100755 addons/account_reports_xlsx/views/general_ledger_report_wizard_view.xml create mode 100755 addons/account_reports_xlsx/views/partner_ledgerreport.xml create mode 100755 addons/account_reports_xlsx/views/report.xml create mode 100755 addons/account_reports_xlsx/views/report_agedpartnerbalance.xml create mode 100755 addons/account_reports_xlsx/views/supplier_aging_report_view.xml create mode 100755 addons/account_reports_xlsx/wizard/__init__.py create mode 100755 addons/account_reports_xlsx/wizard/account_financial_report.py create mode 100755 addons/account_reports_xlsx/wizard/account_financial_report_view.xml create mode 100755 addons/account_reports_xlsx/wizard/account_report_aged_partner_balance.py create mode 100755 addons/account_reports_xlsx/wizard/account_report_aged_partner_balance_view.xml create mode 100755 addons/account_reports_xlsx/wizard/account_report_financial.py create mode 100755 addons/account_reports_xlsx/wizard/account_report_general_ledger.py create mode 100755 addons/account_reports_xlsx/wizard/account_report_general_ledger_view.xml create mode 100755 addons/account_reports_xlsx/wizard/account_report_partner_ledger.py create mode 100755 addons/account_reports_xlsx/wizard/partner_ledger_wizard_view.xml create mode 100644 addons/banner_sale/__init__.py create mode 100644 addons/banner_sale/__manifest__.py create mode 100644 addons/banner_sale/models/__init__.py create mode 100644 addons/banner_sale/models/banner.py create mode 100644 addons/banner_sale/models/banner_category.py create mode 100644 addons/banner_sale/models/coupon_program.py create mode 100644 addons/banner_sale/models/product_brand.py create mode 100644 addons/banner_sale/security/ir.model.access.csv create mode 100644 addons/banner_sale/views/banner.xml create mode 100644 addons/banner_sale/views/banner_category.xml create mode 100644 addons/banner_sale/views/product_brand.xml create mode 100644 addons/mail_reply_to_sender/__init__.py create mode 100644 addons/mail_reply_to_sender/__manifest__.py create mode 100644 addons/mail_reply_to_sender/models/__init__.py create mode 100644 addons/mail_reply_to_sender/models/ir_mail_server.py create mode 100644 addons/mail_reply_to_sender/static/description/banner.png create mode 100644 addons/mail_reply_to_sender/static/description/icon.png create mode 100644 addons/mail_reply_to_sender/static/description/index.html create mode 100644 addons/mail_reply_to_sender/static/description/mail_reply_to_1.png create mode 100644 addons/mail_reply_to_sender/static/description/mail_reply_to_2.png create mode 100644 addons/mail_reply_to_sender/static/description/ppts/odoo-erp-customization.svg create mode 100644 addons/mail_reply_to_sender/static/description/ppts/odoo-erp-implementation.svg create mode 100644 addons/mail_reply_to_sender/static/description/ppts/odoo-erp-integration.svg create mode 100644 addons/mail_reply_to_sender/static/description/ppts/odoo-erp-migration.svg create mode 100644 addons/mail_reply_to_sender/static/description/ppts/odoo-erp-support.svg create mode 100644 addons/mail_reply_to_sender/static/description/reply_to.png create mode 100644 addons/product_brand_sale/README.md create mode 100644 addons/product_brand_sale/__init__.py create mode 100644 addons/product_brand_sale/__manifest__.py create mode 100644 addons/product_brand_sale/doc/RELEASE_NOTES.md create mode 100644 addons/product_brand_sale/models/__init__.py create mode 100644 addons/product_brand_sale/models/brand.py create mode 100644 addons/product_brand_sale/security/ir.model.access.csv create mode 100644 addons/product_brand_sale/static/description/banner.png create mode 100644 addons/product_brand_sale/static/description/icon.png create mode 100644 addons/product_brand_sale/static/description/images/1.jpeg create mode 100644 addons/product_brand_sale/static/description/images/2.jpeg create mode 100644 addons/product_brand_sale/static/description/images/3.jpeg create mode 100644 addons/product_brand_sale/static/description/images/4.jpeg create mode 100644 addons/product_brand_sale/static/description/images/5.jpeg create mode 100644 addons/product_brand_sale/static/description/images/6.jpeg create mode 100644 addons/product_brand_sale/static/description/images/checked.png create mode 100644 addons/product_brand_sale/static/description/images/cybrosys.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand1.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand2.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand3.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand4.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand5.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand6.png create mode 100644 addons/product_brand_sale/static/description/images/productbrand7.png create mode 100644 addons/product_brand_sale/static/description/index.html create mode 100644 addons/product_brand_sale/views/brand_views.xml diff --git a/addons/account_reports_xlsx/README.rst b/addons/account_reports_xlsx/README.rst new file mode 100755 index 0000000..fec390b --- /dev/null +++ b/addons/account_reports_xlsx/README.rst @@ -0,0 +1,19 @@ +Accounting Reports xlsx v14 +=========================== +Shows the Accounting Reports Excel + +Installation +============ + - www.odoo.com/documentation/14.0/setup/install.html + - Install our custom addon + +Configuration +============= + + No additional configurations needed + +Credits +======= + Developer V12: Risha C.T @ cybrosys + Migrated V13: Varsha Vivek K @ cybrosys + Migrated V14: Saurabh @ cybrosys diff --git a/addons/account_reports_xlsx/__init__.py b/addons/account_reports_xlsx/__init__.py new file mode 100755 index 0000000..a7428e0 --- /dev/null +++ b/addons/account_reports_xlsx/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies(odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from . import report +from . import controllers +from . import models +from . import wizard diff --git a/addons/account_reports_xlsx/__manifest__.py b/addons/account_reports_xlsx/__manifest__.py new file mode 100755 index 0000000..9a821cf --- /dev/null +++ b/addons/account_reports_xlsx/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +{ + 'name': 'Accounting Report Excel', + 'version': '14.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Accounting', + 'live_test_url': 'https://www.youtube.com/watch?v=Sch1VcrunT0&list=PLeJtXzTubzj_wOC0fzgSAyGln4TJWKV4k&index=33', + 'summary': """Generates Excel report for Partner Ledger,General Ledger,Balance Sheet, + Profit and Loss,Aged Partner Balance.""", + 'description': """Generates Excel reports, + Accounting Reports, Odoo 14, Odoo 14 report,Odoo 14 Accounting Report,Odoo 14 Excel Report, Partner Profit and Loss,Aged Partner Balance,Ledger,General Ledger,Balance Sheet,Account Reports, Excel Report, Excel, Xlsx Report, xlsx,Accounting Excel Reports, Account Excel Reports""", + 'depends': ['base', 'account'], + 'data': [ + 'views/action_manager.xml', + 'security/ir.model.access.csv', + 'views/report_agedpartnerbalance.xml', + 'wizard/partner_ledger_wizard_view.xml', + 'views/partner_ledgerreport.xml', + 'wizard/account_report_aged_partner_balance_view.xml', + 'wizard/account_report_general_ledger_view.xml', + 'wizard/account_financial_report_view.xml', + 'views/account_financial_report_data.xml', + ], + 'license': 'OPL-1', + 'price': 19.99, + 'currency': 'EUR', + 'images': ['static/description/banner.png'], + 'auto_install': False, + 'installable': True, + 'application': True, +} diff --git a/addons/account_reports_xlsx/controllers/__init__.py b/addons/account_reports_xlsx/controllers/__init__.py new file mode 100755 index 0000000..593cba3 --- /dev/null +++ b/addons/account_reports_xlsx/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from . import main diff --git a/addons/account_reports_xlsx/controllers/main.py b/addons/account_reports_xlsx/controllers/main.py new file mode 100755 index 0000000..3a886bf --- /dev/null +++ b/addons/account_reports_xlsx/controllers/main.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.addons.web.controllers.main import _serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + + @http.route('/xlsx_reports', type='http', auth='user', methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, token, report_name, **kw): + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + options = json.loads(options) + 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))) \ No newline at end of file diff --git a/addons/account_reports_xlsx/doc/RELEASE_NOTES.md b/addons/account_reports_xlsx/doc/RELEASE_NOTES.md new file mode 100755 index 0000000..50d36c1 --- /dev/null +++ b/addons/account_reports_xlsx/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 30.10.2020 +##### Version 14.0.1.0.0 +###### ADD +- Initial commit for Accounting Reports Excel \ No newline at end of file diff --git a/addons/account_reports_xlsx/models/__init__.py b/addons/account_reports_xlsx/models/__init__.py new file mode 100755 index 0000000..f7265a3 --- /dev/null +++ b/addons/account_reports_xlsx/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from . import account_partner_ledger +from . import account_aged_partner_balance +from . import account_general_ledger +from . import account_financial_report diff --git a/addons/account_reports_xlsx/models/account_aged_partner_balance.py b/addons/account_reports_xlsx/models/account_aged_partner_balance.py new file mode 100755 index 0000000..1f6eef7 --- /dev/null +++ b/addons/account_reports_xlsx/models/account_aged_partner_balance.py @@ -0,0 +1,266 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +import time +from odoo import api, models, _ +from odoo.exceptions import UserError +from odoo.tools import float_is_zero +from datetime import datetime +from dateutil.relativedelta import relativedelta + + +class ReportAgedPartnerBalance(models.AbstractModel): + + _inherit = 'report.account_reports_xlsx.report_agedpartnerbalance' + + def _get_partner_move_lines(self, account_type, date_from, target_move, period_length): + # This method can receive the context key 'include_nullified_amount' {Boolean} + # Do an invoice and a payment and unreconcile. The amount will be nullified + # By default, the partner wouldn't appear in this report. + # The context key allow it to appear + # In case of a period_length of 30 days as of 2020-02-08, we want the following periods: + # Name Stop Start + # 1 - 30 : 2020-02-07 - 2020-01-09 + # 31 - 60 : 2020-01-08 - 2018-12-10 + # 61 - 90 : 2018-12-09 - 2018-11-10 + # 91 - 120 : 2018-11-09 - 2018-10-11 + # +120 : 2018-10-10 + periods = {} + if date_from is False: + raise UserError(_("You must set a start date")) + start = datetime.strptime(str(date_from), "%Y-%m-%d") + for i in range(5)[::-1]: + stop = start - relativedelta(days=period_length) + period_name = str((5-(i+1)) * period_length + 1) + '-' + str((5-i) * period_length) + period_stop = (start - relativedelta(days=1)).strftime('%Y-%m-%d') + if i == 0: + period_name = '+' + str(4 * period_length) + periods[str(i)] = { + 'name': period_name, + 'stop': period_stop, + 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False), + } + start = stop + + res = [] + total = [] + cr = self.env.cr + user_company = self.env.user.company_id + user_currency = user_company.currency_id + ResCurrency = self.env['res.currency'].with_context(date=date_from) + company_ids = self._context.get('company_ids') or [user_company.id] + move_state = ['draft', 'posted'] + if target_move == 'posted': + move_state = ['posted'] + arg_list = (tuple(move_state), tuple(account_type)) + #build the reconciliation clause to see what partner needs to be printed + reconciliation_clause = '(l.reconciled IS FALSE)' + cr.execute('SELECT debit_move_id, credit_move_id FROM account_partial_reconcile where max_date > %s', (date_from,)) + reconciled_after_date = [] + for row in cr.fetchall(): + reconciled_after_date += [row[0], row[1]] + if reconciled_after_date: + reconciliation_clause = '(l.reconciled IS FALSE OR l.id IN %s)' + arg_list += (tuple(reconciled_after_date),) + arg_list += (date_from, tuple(company_ids)) + query = ''' + SELECT DISTINCT l.partner_id, UPPER(res_partner.name) + FROM account_move_line AS l left join res_partner on l.partner_id = res_partner.id, account_account, account_move am + WHERE (l.account_id = account_account.id) + AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND ''' + reconciliation_clause + ''' + AND (l.date <= %s) + AND l.company_id IN %s + ORDER BY UPPER(res_partner.name)''' + cr.execute(query, arg_list) + + partners = cr.dictfetchall() + # put a total of 0 + for i in range(7): + total.append(0) + + # Build a string like (1,2,3) for easy use in SQL query + partner_ids = [partner['partner_id'] for partner in partners if partner['partner_id']] + lines = dict((partner['partner_id'] or False, []) for partner in partners) + if not partner_ids: + return [], [], {} + + # This dictionary will store the not due amount of all partners + undue_amounts = {} + query = '''SELECT l.id + FROM account_move_line AS l, account_account, account_move am + WHERE (l.account_id = account_account.id) AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND (COALESCE(l.date_maturity,l.date) >= %s)\ + AND ((l.partner_id IN %s) OR (l.partner_id IS NULL)) + AND (l.date <= %s) + AND l.company_id IN %s''' + cr.execute(query, (tuple(move_state), tuple(account_type), date_from, tuple(partner_ids), date_from, tuple(company_ids))) + aml_ids = cr.fetchall() + aml_ids = aml_ids and [x[0] for x in aml_ids] or [] + for line in self.env['account.move.line'].browse(aml_ids): + partner_id = line.partner_id.id or False + if partner_id not in undue_amounts: + undue_amounts[partner_id] = 0.0 + line_amount = ResCurrency._compute(line.company_id.currency_id, user_currency, line.balance) + if user_currency.is_zero(line_amount): + continue + for partial_line in line.matched_debit_ids: + if str(partial_line.max_date) <= date_from: + line_amount += ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount) + for partial_line in line.matched_credit_ids: + if str(partial_line.max_date) <= date_from: + line_amount -= ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount) + if not self.env.user.company_id.currency_id.is_zero(line_amount): + undue_amounts[partner_id] += line_amount + lines[partner_id].append({ + 'line': line, + 'amount': line_amount, + 'period': 6, + }) + + # Use one query per period and store results in history (a list variable) + # Each history will contain: history[1] = {'': } + history = [] + for i in range(5): + args_list = (tuple(move_state), tuple(account_type), tuple(partner_ids),) + dates_query = '(COALESCE(l.date_maturity,l.date)' + + if periods[str(i)]['start'] and periods[str(i)]['stop']: + dates_query += ' BETWEEN %s AND %s)' + args_list += (periods[str(i)]['start'], periods[str(i)]['stop']) + elif periods[str(i)]['start']: + dates_query += ' >= %s)' + args_list += (periods[str(i)]['start'],) + else: + dates_query += ' <= %s)' + args_list += (periods[str(i)]['stop'],) + args_list += (date_from, tuple(company_ids)) + + query = '''SELECT l.id + FROM account_move_line AS l, account_account, account_move am + WHERE (l.account_id = account_account.id) AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND ((l.partner_id IN %s) OR (l.partner_id IS NULL)) + AND ''' + dates_query + ''' + AND (l.date <= %s) + AND l.company_id IN %s''' + cr.execute(query, args_list) + partners_amount = {} + aml_ids = cr.fetchall() + aml_ids = aml_ids and [x[0] for x in aml_ids] or [] + for line in self.env['account.move.line'].browse(aml_ids).with_context(prefetch_fields=False): + partner_id = line.partner_id.id or False + if partner_id not in partners_amount: + partners_amount[partner_id] = 0.0 + line_amount = ResCurrency._compute(line.company_id.currency_id, user_currency, line.balance) + if user_currency.is_zero(line_amount): + continue + for partial_line in line.matched_debit_ids: + if str(partial_line.max_date) <= date_from: + line_amount += ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount) + for partial_line in line.matched_credit_ids: + if str(partial_line.max_date) <= date_from: + line_amount -= ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount) + + if not self.env.user.company_id.currency_id.is_zero(line_amount): + partners_amount[partner_id] += line_amount + lines[partner_id].append({ + 'line': line, + 'amount': line_amount, + 'period': i + 1, + }) + history.append(partners_amount) + + for partner in partners: + if partner['partner_id'] is None: + partner['partner_id'] = False + at_least_one_amount = False + values = {} + undue_amt = 0.0 + if partner['partner_id'] in undue_amounts: # Making sure this partner actually was found by the query + undue_amt = undue_amounts[partner['partner_id']] + + total[6] = total[6] + undue_amt + values['direction'] = undue_amt + if not float_is_zero(values['direction'], precision_rounding=self.env.user.company_id.currency_id.rounding): + at_least_one_amount = True + + for i in range(5): + during = False + if partner['partner_id'] in history[i]: + during = [history[i][partner['partner_id']]] + # Adding counter + total[(i)] = total[(i)] + (during and during[0] or 0) + values[str(i)] = during and during[0] or 0.0 + if not float_is_zero(values[str(i)], precision_rounding=self.env.user.company_id.currency_id.rounding): + at_least_one_amount = True + values['total'] = sum([values['direction']] + [values[str(i)] for i in range(5)]) + ## Add for total + total[(i + 1)] += values['total'] + values['partner_id'] = partner['partner_id'] + if partner['partner_id']: + browsed_partner = self.env['res.partner'].browse(partner['partner_id']) + values['name'] = browsed_partner.name and len(browsed_partner.name) >= 45 and browsed_partner.name[0:40] + '...' or browsed_partner.name + values['trust'] = browsed_partner.trust + else: + values['name'] = _('Unknown Partner') + values['trust'] = False + + if at_least_one_amount or (self._context.get('include_nullified_amount') and lines[partner['partner_id']]): + res.append(values) + + return res, total, lines + + @api.model + def get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get('active_model') or not self.env.context.get('active_id'): + raise UserError(_("Form content is missing, this report cannot be printed.")) + + total = [] + model = self.env.context.get('active_model') + docs = self.env[model].browse(self.env.context.get('active_id')) + + target_move = data['form'].get('target_move', 'all') + date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d')) + + if data['form']['result_selection'] == 'customer': + account_type = ['receivable'] + elif data['form']['result_selection'] == 'supplier': + account_type = ['payable'] + else: + account_type = ['payable', 'receivable'] + + movelines, total, dummy = self._get_partner_move_lines(account_type, date_from, target_move, data['form']['period_length']) + return { + 'doc_ids': self.ids, + 'doc_model': model, + 'data': data['form'], + 'docs': docs, + 'time': time, + 'get_partner_lines': movelines, + 'get_direction': total, + } diff --git a/addons/account_reports_xlsx/models/account_financial_report.py b/addons/account_reports_xlsx/models/account_financial_report.py new file mode 100755 index 0000000..fad2359 --- /dev/null +++ b/addons/account_reports_xlsx/models/account_financial_report.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +from odoo import api, models, fields, _ + + +# --------------------------------------------------------- +# Account Financial Report +# --------------------------------------------------------- + + +class AccountFinancialReport(models.Model): + _name = "account.financial.report" + _description = "Account Report" + + @api.depends('parent_id', 'parent_id.level') + def _get_level(self): + '''Returns a dictionary with key=the ID of a record and value = the level of this + record in the tree structure.''' + for report in self: + level = 0 + if report.parent_id: + level = report.parent_id.level + 1 + report.level = level + + def _get_children_by_order(self): + '''returns a recordset of all the children computed recursively, and sorted by sequence. Ready for the printing''' + res = self + children = self.search([('parent_id', 'in', self.ids)], order='sequence ASC') + if children: + for child in children: + res += child._get_children_by_order() + return res + + name = fields.Char('Report Name', required=True, translate=True) + parent_id = fields.Many2one('account.financial.report', 'Parent') + children_ids = fields.One2many('account.financial.report', 'parent_id', 'Account Report') + sequence = fields.Integer('Sequence') + level = fields.Integer(compute='_get_level', string='Level', store=True) + type = fields.Selection([ + ('sum', 'View'), + ('accounts', 'Accounts'), + ('account_type', 'Account Type'), + ('account_report', 'Report Value'), + ], 'Type', default='sum') + account_ids = fields.Many2many('account.account', 'account_account_financial_report', 'report_line_id', + 'account_id', 'Accounts') + account_report_id = fields.Many2one('account.financial.report', 'Report Value') + account_type_ids = fields.Many2many('account.account.type', 'account_account_financial_report_type', 'report_id', + 'account_type_id', 'Account Types') + sign = fields.Selection([ + ('-1', 'Reverse balance sign'), + ('1', 'Preserve balance sign')], + 'Sign on Reports', + required=True, + default='1', + help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.') + display_detail = fields.Selection([ + ('no_detail', 'No detail'), + ('detail_flat', 'Display children flat'), + ('detail_with_hierarchy', 'Display children with hierarchy') + ], 'Display details', default='detail_flat') + style_overwrite = fields.Selection([ + ('0', 'Automatic formatting'), + ('1', 'Main Title 1 (bold, underlined)'), + ('2', 'Title 2 (bold)'), + ('3', 'Title 3 (bold, smaller)'), + ('4', 'Normal Text'), + ('5', 'Italic Text (smaller)'), + ('6', 'Smallest Text'), + ], 'Financial Report Style', default='0', + help="You can set up here the format you want this record to be displayed. If you leave the automatic formatting, it will be computed based on the financial reports hierarchy (auto-computed field 'level').") diff --git a/addons/account_reports_xlsx/models/account_general_ledger.py b/addons/account_reports_xlsx/models/account_general_ledger.py new file mode 100755 index 0000000..ded77f4 --- /dev/null +++ b/addons/account_reports_xlsx/models/account_general_ledger.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +import time +from odoo import api, models, _ +from odoo.exceptions import UserError + + +class ReportGeneralLedger(models.AbstractModel): + _name = 'report.account.report_generalledger' + + def _get_account_move_entry(self, accounts, init_balance, sortby, display_account): + """ + :param: + accounts: the recordset of accounts + init_balance: boolean value of initial_balance + sortby: sorting by date or partner and journal + display_account: type of account(receivable, payable and both) + + Returns a dictionary of accounts with following key and value { + 'code': account code, + 'name': account name, + 'debit': sum of total debit amount, + 'credit': sum of total credit amount, + 'balance': total balance, + 'amount_currency': sum of amount_currency, + 'move_lines': list of move line + } + """ + cr = self.env.cr + MoveLine = self.env['account.move.line'] + move_lines = {x: [] for x in accounts.ids} + + # Prepare initial sql query and Get the initial move lines + if init_balance: + init_tables, init_where_clause, init_where_params = MoveLine.with_context(date_from=self.env.context.get('date_from'), date_to=False, initial_bal=True)._query_get() + init_wheres = [""] + if init_where_clause.strip(): + init_wheres.append(init_where_clause.strip()) + init_filters = " AND ".join(init_wheres) + filters = init_filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l') + sql = ("""SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate, '' AS lcode, 0.0 AS amount_currency, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance, '' AS lpartner_id,\ + '' AS move_name, '' AS mmove_id, '' AS currency_code,\ + NULL AS currency_id,\ + '' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\ + '' AS partner_name\ + FROM account_move_line l\ + LEFT JOIN account_move m ON (l.move_id=m.id)\ + LEFT JOIN res_currency c ON (l.currency_id=c.id)\ + LEFT JOIN res_partner p ON (l.partner_id=p.id)\ + LEFT JOIN account_move i ON (m.id =i.id)\ + JOIN account_journal j ON (l.journal_id=j.id)\ + WHERE l.account_id IN %s""" + filters + ' GROUP BY l.account_id') + params = (tuple(accounts.ids),) + tuple(init_where_params) + cr.execute(sql, params) + for row in cr.dictfetchall(): + move_lines[row.pop('account_id')].append(row) + + sql_sort = 'l.date, l.move_id' + if sortby == 'sort_journal_partner': + sql_sort = 'j.code, p.name, l.move_id' + + # Prepare sql query base on selected parameters from wizard + tables, where_clause, where_params = MoveLine._query_get() + wheres = [""] + if where_clause.strip(): + wheres.append(where_clause.strip()) + filters = " AND ".join(wheres) + filters = filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l') + + # Get move lines base on sql query and Calculate the total balance of move lines + sql = ('''SELECT l.id AS lid, l.account_id AS account_id, l.date AS ldate, j.code AS lcode, l.currency_id, l.amount_currency, l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,\ + m.name AS move_name, c.symbol AS currency_code, p.name AS partner_name\ + FROM account_move_line l\ + JOIN account_move m ON (l.move_id=m.id)\ + LEFT JOIN res_currency c ON (l.currency_id=c.id)\ + LEFT JOIN res_partner p ON (l.partner_id=p.id)\ + JOIN account_journal j ON (l.journal_id=j.id)\ + JOIN account_account acc ON (l.account_id = acc.id) \ + WHERE l.account_id IN %s ''' + filters + ''' GROUP BY l.id, l.account_id, l.date, j.code, l.currency_id, l.amount_currency, l.ref, l.name, m.name, c.symbol, p.name ORDER BY ''' + sql_sort) + params = (tuple(accounts.ids),) + tuple(where_params) + cr.execute(sql, params) + + for row in cr.dictfetchall(): + balance = 0 + for line in move_lines.get(row['account_id']): + balance += line['debit'] - line['credit'] + row['balance'] += balance + move_lines[row.pop('account_id')].append(row) + + # Calculate the debit, credit and balance for Accounts + account_res = [] + for account in accounts: + currency = account.currency_id and account.currency_id or account.company_id.currency_id + res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance']) + res['code'] = account.code + res['name'] = account.name + res['company_id'] = account.company_id.id + res['move_lines'] = move_lines[account.id] + for line in res.get('move_lines'): + res['debit'] += line['debit'] + res['credit'] += line['credit'] + res['balance'] = line['balance'] + if display_account == 'all': + account_res.append(res) + if display_account == 'movement' and res.get('move_lines'): + account_res.append(res) + if display_account == 'not_zero' and not currency.is_zero(res['balance']): + account_res.append(res) + return account_res + + @api.model + def _get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get('active_model'): + raise UserError(_("Form content is missing, this report cannot be printed.")) + + model = self.env.context.get('active_model') + docs = self.env[model].browse(self.env.context.get('active_ids', [])) + + init_balance = data['form'].get('initial_balance', True) + sortby = data['form'].get('sortby', 'sort_date') + display_account = data['form']['display_account'] + codes = [] + if data['form'].get('journal_ids', False): + codes = [journal.code for journal in self.env['account.journal'].search([('id', 'in', data['form']['journal_ids'])])] + + accounts = docs if model == 'account.account' else self.env['account.account'].search([]) + accounts_res = self.with_context(data['form'].get('used_context',{}))._get_account_move_entry(accounts, init_balance, sortby, display_account) + return { + 'doc_ids': docids, + 'doc_model': model, + 'data': data['form'], + 'docs': docs, + 'time': time, + 'Accounts': accounts_res, + 'print_journal': codes, + } diff --git a/addons/account_reports_xlsx/models/account_partner_ledger.py b/addons/account_reports_xlsx/models/account_partner_ledger.py new file mode 100755 index 0000000..51a7df2 --- /dev/null +++ b/addons/account_reports_xlsx/models/account_partner_ledger.py @@ -0,0 +1,151 @@ +# -*- coding: utf-8 -*- +###################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +######################################################################################## + +import logging +from datetime import datetime +import time +from odoo import api, models, _ +from odoo.exceptions import UserError +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT + +_logger = logging.getLogger(__name__) + + +class ReportPartnerLedger(models.AbstractModel): + _name = 'report.account_reports_xlsx.report_partnerledger' + + def _lines(self, data, partner): + full_account = [] + currency = self.env['res.currency'] + query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() + reconcile_clause = "" if data['form']['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' + params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] + query = """ + SELECT "account_move_line".id, "account_move_line".date, j.code, acc.code as a_code, acc.name as a_name, "account_move_line".ref, m.name as move_name, "account_move_line".name, "account_move_line".debit, "account_move_line".credit, "account_move_line".amount_currency,"account_move_line".currency_id, c.symbol AS currency_code + FROM """ + query_get_data[0] + """ + LEFT JOIN account_journal j ON ("account_move_line".journal_id = j.id) + LEFT JOIN account_account acc ON ("account_move_line".account_id = acc.id) + LEFT JOIN res_currency c ON ("account_move_line".currency_id=c.id) + LEFT JOIN account_move m ON (m.id="account_move_line".move_id) + WHERE "account_move_line".partner_id = %s + AND m.state IN %s + AND "account_move_line".account_id IN %s AND """ + query_get_data[1] + reconcile_clause + """ + ORDER BY "account_move_line".date""" + self.env.cr.execute(query, tuple(params)) + res = self.env.cr.dictfetchall() + sum = 0.0 + lang_code = self.env.context.get('lang') or 'en_US' + lang = self.env['res.lang'] + lang_id = lang._lang_get(lang_code) + date_format = lang_id.date_format + for r in res: + r['date'] = datetime.strptime(str(r['date']), DEFAULT_SERVER_DATE_FORMAT).strftime(date_format) + r['displayed_name'] = '-'.join( + r[field_name] for field_name in ('move_name', 'ref', 'name') + if r[field_name] not in (None, '', '/') + ) + sum += r['debit'] - r['credit'] + r['progress'] = sum + r['currency_id'] = currency.browse(r.get('currency_id')) + full_account.append(r) + return full_account + + def _sum_partner(self, data, partner, field): + if field not in ['debit', 'credit', 'debit - credit', 'amount_currency']: + return + result = 0.0 + query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() + reconcile_clause = "" if data['form']['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' + + params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] + query = """SELECT sum(""" + field + """) + FROM """ + query_get_data[0] + """, account_move AS m + WHERE "account_move_line".partner_id = %s + AND m.id = "account_move_line".move_id + AND m.state IN %s + AND account_id IN %s + AND """ + query_get_data[1] + reconcile_clause + self.env.cr.execute(query, tuple(params)) + + contemp = self.env.cr.fetchone() + if contemp is not None: + result = contemp[0] or 0.0 + return result + + @api.model + def get_report_values(self, docids, data=None): + if not data.get('form'): + raise UserError(_("Form content is missing, this report cannot be printed.")) + + data['computed'] = {} + + obj_partner = self.env['res.partner'] + query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() + data['computed']['move_state'] = ['draft', 'posted'] + if data['form'].get('target_move', 'all') == 'posted': + data['computed']['move_state'] = ['posted'] + result_selection = data['form'].get('result_selection', 'customer') + if result_selection == 'supplier': + data['computed']['ACCOUNT_TYPE'] = ['payable'] + elif result_selection == 'customer': + data['computed']['ACCOUNT_TYPE'] = ['receivable'] + else: + data['computed']['ACCOUNT_TYPE'] = ['payable', 'receivable'] + + self.env.cr.execute(""" + SELECT a.id + FROM account_account a + WHERE a.internal_type IN %s + AND NOT a.deprecated""", (tuple(data['computed']['ACCOUNT_TYPE']),)) + data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()] + params = [tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] + reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' + query = """ + SELECT DISTINCT "account_move_line".partner_id + FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am + WHERE "account_move_line".partner_id IS NOT NULL + AND "account_move_line".account_id = account.id + AND am.id = "account_move_line".move_id + AND am.state IN %s + AND "account_move_line".account_id IN %s + AND NOT account.deprecated + AND """ + query_get_data[1] + reconcile_clause + self.env.cr.execute(query, tuple(params)) + # ---------------------Taking only selected partners--------------------------- + if data['form']['partner_ids']: + partner_ids = data['form']['partner_ids'] + else: + partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] + # ----------------------------------------------------------------------------- + # partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] + partners = obj_partner.browse(partner_ids) + partners = sorted(partners, key=lambda x: (x.ref or '', x.name or '')) + + return { + 'doc_ids': partner_ids, + 'doc_model': self.env['res.partner'], + 'data': data, + 'docs': partners, + 'time': time, + 'lines': self._lines, + 'sum_partner': self._sum_partner, + } diff --git a/addons/account_reports_xlsx/report/__init__.py b/addons/account_reports_xlsx/report/__init__.py new file mode 100755 index 0000000..76740c2 --- /dev/null +++ b/addons/account_reports_xlsx/report/__init__.py @@ -0,0 +1 @@ +from . import account_aged_partner_balance diff --git a/addons/account_reports_xlsx/report/account_aged_partner_balance.py b/addons/account_reports_xlsx/report/account_aged_partner_balance.py new file mode 100755 index 0000000..b88782a --- /dev/null +++ b/addons/account_reports_xlsx/report/account_aged_partner_balance.py @@ -0,0 +1,261 @@ +# -*- coding: utf-8 -*- + +import time +from odoo import api, fields, models, _ +from odoo.exceptions import UserError +from odoo.tools import float_is_zero +from datetime import datetime +from dateutil.relativedelta import relativedelta + +class ReportAgedPartnerBalance(models.AbstractModel): + + _name = 'report.account_reports_xlsx.report_agedpartnerbalance' + _description = 'Aged Partner Balance Report' + + def _get_partner_move_lines(self, account_type, date_from, target_move, period_length): + # This method can receive the context key 'include_nullified_amount' {Boolean} + # Do an invoice and a payment and unreconcile. The amount will be nullified + # By default, the partner wouldn't appear in this report. + # The context key allow it to appear + # In case of a period_length of 30 days as of 2020-02-08, we want the following periods: + # Name Stop Start + # 1 - 30 : 2020-02-07 - 2020-01-09 + # 31 - 60 : 2020-01-08 - 2018-12-10 + # 61 - 90 : 2018-12-09 - 2018-11-10 + # 91 - 120 : 2018-11-09 - 2018-10-11 + # +120 : 2018-10-10 + ctx = self._context + periods = {} + date_from = fields.Date.from_string(date_from) + start = date_from + for i in range(5)[::-1]: + stop = start - relativedelta(days=period_length) + period_name = str((5-(i+1)) * period_length + 1) + '-' + str((5-i) * period_length) + period_stop = (start - relativedelta(days=1)).strftime('%Y-%m-%d') + if i == 0: + period_name = '+' + str(4 * period_length) + periods[str(i)] = { + 'name': period_name, + 'stop': period_stop, + 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False), + } + start = stop + + res = [] + total = [] + partner_clause = '' + cr = self.env.cr + user_company = self.env.company + user_currency = user_company.currency_id + company_ids = self._context.get('company_ids') or [user_company.id] + move_state = ['draft', 'posted'] + if target_move == 'posted': + move_state = ['posted'] + arg_list = (tuple(move_state), tuple(account_type), date_from, date_from,) + if ctx.get('partner_ids'): + partner_clause = 'AND (l.partner_id IN %s)' + arg_list += (tuple(ctx['partner_ids'].ids),) + if ctx.get('partner_categories'): + partner_clause += 'AND (l.partner_id IN %s)' + partner_ids = self.env['res.partner'].search([('category_id', 'in', ctx['partner_categories'].ids)]).ids + arg_list += (tuple(partner_ids or [0]),) + arg_list += (date_from, tuple(company_ids)) + + query = ''' + SELECT DISTINCT l.partner_id, res_partner.name AS name, UPPER(res_partner.name) AS UPNAME, CASE WHEN prop.value_text IS NULL THEN 'normal' ELSE prop.value_text END AS trust + FROM account_move_line AS l + LEFT JOIN res_partner ON l.partner_id = res_partner.id + LEFT JOIN ir_property prop ON (prop.res_id = 'res.partner,'||res_partner.id AND prop.name='trust' AND prop.company_id=%s), + account_account, account_move am + WHERE (l.account_id = account_account.id) + AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND ( + l.reconciled IS FALSE + OR l.id IN( + SELECT credit_move_id FROM account_partial_reconcile where max_date > %s + UNION ALL + SELECT debit_move_id FROM account_partial_reconcile where max_date > %s + ) + ) + ''' + partner_clause + ''' + AND (l.date <= %s) + AND l.company_id IN %s + ORDER BY UPPER(res_partner.name)''' + arg_list = (self.env.company.id,) + arg_list + cr.execute(query, arg_list) + + partners = cr.dictfetchall() + # put a total of 0 + for i in range(7): + total.append(0) + + # Build a string like (1,2,3) for easy use in SQL query + partner_ids = [partner['partner_id'] for partner in partners if partner['partner_id']] + lines = dict((partner['partner_id'] or False, []) for partner in partners) + if not partner_ids: + return [], [], {} + + # Use one query per period and store results in history (a list variable) + # Each history will contain: history[1] = {'': } + history = [] + for i in range(5): + args_list = (tuple(move_state), tuple(account_type), tuple(partner_ids),) + dates_query = '(COALESCE(l.date_maturity,l.date)' + + if periods[str(i)]['start'] and periods[str(i)]['stop']: + dates_query += ' BETWEEN %s AND %s)' + args_list += (periods[str(i)]['start'], periods[str(i)]['stop']) + elif periods[str(i)]['start']: + dates_query += ' >= %s)' + args_list += (periods[str(i)]['start'],) + else: + dates_query += ' <= %s)' + args_list += (periods[str(i)]['stop'],) + args_list += (date_from, tuple(company_ids)) + + query = '''SELECT l.id + FROM account_move_line AS l, account_account, account_move am + WHERE (l.account_id = account_account.id) AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND ((l.partner_id IN %s) OR (l.partner_id IS NULL)) + AND ''' + dates_query + ''' + AND (l.date <= %s) + AND l.company_id IN %s + ORDER BY COALESCE(l.date_maturity, l.date)''' + cr.execute(query, args_list) + partners_amount = {} + aml_ids = cr.fetchall() + aml_ids = aml_ids and [x[0] for x in aml_ids] or [] + for line in self.env['account.move.line'].browse(aml_ids).with_context(prefetch_fields=False): + partner_id = line.partner_id.id or False + if partner_id not in partners_amount: + partners_amount[partner_id] = 0.0 + line_amount = line.company_id.currency_id._convert(line.balance, user_currency, user_company, date_from) + if user_currency.is_zero(line_amount): + continue + for partial_line in line.matched_debit_ids: + if partial_line.max_date <= date_from: + line_amount += partial_line.company_id.currency_id._convert(partial_line.amount, user_currency, user_company, date_from) + for partial_line in line.matched_credit_ids: + if partial_line.max_date <= date_from: + line_amount -= partial_line.company_id.currency_id._convert(partial_line.amount, user_currency, user_company, date_from) + + if not self.env.company.currency_id.is_zero(line_amount): + partners_amount[partner_id] += line_amount + lines.setdefault(partner_id, []) + lines[partner_id].append({ + 'line': line, + 'amount': line_amount, + 'period': i + 1, + }) + history.append(partners_amount) + + # This dictionary will store the not due amount of all partners + undue_amounts = {} + query = '''SELECT l.id + FROM account_move_line AS l, account_account, account_move am + WHERE (l.account_id = account_account.id) AND (l.move_id = am.id) + AND (am.state IN %s) + AND (account_account.internal_type IN %s) + AND (COALESCE(l.date_maturity,l.date) >= %s)\ + AND ((l.partner_id IN %s) OR (l.partner_id IS NULL)) + AND (l.date <= %s) + AND l.company_id IN %s + ORDER BY COALESCE(l.date_maturity, l.date)''' + cr.execute(query, (tuple(move_state), tuple(account_type), date_from, tuple(partner_ids), date_from, tuple(company_ids))) + aml_ids = cr.fetchall() + aml_ids = aml_ids and [x[0] for x in aml_ids] or [] + for line in self.env['account.move.line'].browse(aml_ids): + partner_id = line.partner_id.id or False + if partner_id not in undue_amounts: + undue_amounts[partner_id] = 0.0 + line_amount = line.company_id.currency_id._convert(line.balance, user_currency, user_company, date_from) + if user_currency.is_zero(line_amount): + continue + for partial_line in line.matched_debit_ids: + if partial_line.max_date <= date_from: + line_amount += partial_line.company_id.currency_id._convert(partial_line.amount, user_currency, user_company, date_from) + for partial_line in line.matched_credit_ids: + if partial_line.max_date <= date_from: + line_amount -= partial_line.company_id.currency_id._convert(partial_line.amount, user_currency, user_company, date_from) + if not self.env.company.currency_id.is_zero(line_amount): + undue_amounts[partner_id] += line_amount + lines.setdefault(partner_id, []) + lines[partner_id].append({ + 'line': line, + 'amount': line_amount, + 'period': 6, + }) + + for partner in partners: + if partner['partner_id'] is None: + partner['partner_id'] = False + at_least_one_amount = False + values = {} + undue_amt = 0.0 + if partner['partner_id'] in undue_amounts: # Making sure this partner actually was found by the query + undue_amt = undue_amounts[partner['partner_id']] + + total[6] = total[6] + undue_amt + values['direction'] = undue_amt + if not float_is_zero(values['direction'], precision_rounding=self.env.company.currency_id.rounding): + at_least_one_amount = True + + for i in range(5): + during = False + if partner['partner_id'] in history[i]: + during = [history[i][partner['partner_id']]] + # Adding counter + total[(i)] = total[(i)] + (during and during[0] or 0) + values[str(i)] = during and during[0] or 0.0 + if not float_is_zero(values[str(i)], precision_rounding=self.env.company.currency_id.rounding): + at_least_one_amount = True + values['total'] = sum([values['direction']] + [values[str(i)] for i in range(5)]) + # Add for total + total[(i + 1)] += values['total'] + values['partner_id'] = partner['partner_id'] + if partner['partner_id']: + values['name'] = len(partner['name']) >= 45 and partner['name'][0:40] + '...' or partner['name'] + values['trust'] = partner['trust'] + else: + values['name'] = _('Unknown Partner') + values['trust'] = False + + if at_least_one_amount or (self._context.get('include_nullified_amount') and lines[partner['partner_id']]): + res.append(values) + return res, total, lines + + @api.model + def _get_report_values(self, docids, data=None): + if not data.get('form') or not self.env.context.get('active_model') or not self.env.context.get('active_id'): + raise UserError(_("Form content is missing, this report cannot be printed.")) + + total = [] + model = self.env.context.get('active_model') + docs = self.env[model].browse(self.env.context.get('active_id')) + + target_move = data['form'].get('target_move', 'all') + date_from = fields.Date.from_string(data['form'].get('date_from')) or fields.Date.today() + + if data['form']['result_selection'] == 'customer': + account_type = ['receivable'] + elif data['form']['result_selection'] == 'supplier': + account_type = ['payable'] + else: + account_type = ['payable', 'receivable'] + + movelines, total, dummy = self._get_partner_move_lines(account_type, date_from, target_move, data['form']['period_length']) + return { + 'doc_ids': self.ids, + 'doc_model': model, + 'data': data['form'], + 'docs': docs, + 'time': time, + 'get_partner_lines': movelines, + 'get_direction': total, + 'company_id': self.env['res.company'].browse( + data['form']['company_id'][0]), + } diff --git a/addons/account_reports_xlsx/security/ir.model.access.csv b/addons/account_reports_xlsx/security/ir.model.access.csv new file mode 100755 index 0000000..a5410fe --- /dev/null +++ b/addons/account_reports_xlsx/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_xlsx_reports,account.financial.report.manager,model_account_financial_report,account.group_account_manager,1,1,1,1 +access_account_aged_trial_balance_xlsx,access.account.aged.trial.balance.xlsx,model_account_aged_trial_balance_xlsx,account.group_account_user,1,1,1,1 +access_account_report_partner_ledger_xlsx,access.account.report.partner.ledger.xlsx,model_account_report_partner_ledger_xlsx,account.group_account_user,1,1,1,1 +access_account_report_general_ledger_xlsx,access.account.report.general.ledger.xlsx,model_account_report_general_ledger_xlsx,account.group_account_user,1,1,1,1 +access_accounting_report_xlsx,access.accounting.report.xlsx,model_accounting_report_xlsx,account.group_account_user,1,1,1,1 +access_report_account_reports_xlsx_report_agedpartnerbalance,access.report.account_reports_xlsx.report_agedpartnerbalance,model_report_account_reports_xlsx_report_agedpartnerbalance,account.group_account_user,1,1,1,1 \ No newline at end of file diff --git a/addons/account_reports_xlsx/static/description/banner.png b/addons/account_reports_xlsx/static/description/banner.png new file mode 100755 index 0000000..d93f8da Binary files /dev/null and b/addons/account_reports_xlsx/static/description/banner.png differ diff --git a/addons/account_reports_xlsx/static/description/icon.png b/addons/account_reports_xlsx/static/description/icon.png new file mode 100755 index 0000000..7dd03bb Binary files /dev/null and b/addons/account_reports_xlsx/static/description/icon.png differ diff --git a/addons/account_reports_xlsx/static/description/images/Accounting Reports in Excel.png b/addons/account_reports_xlsx/static/description/images/Accounting Reports in Excel.png new file mode 100755 index 0000000..3bb18fd Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/Accounting Reports in Excel.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_Report_2.png b/addons/account_reports_xlsx/static/description/images/account_Report_2.png new file mode 100755 index 0000000..afec944 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_Report_2.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report.png b/addons/account_reports_xlsx/static/description/images/account_report.png new file mode 100755 index 0000000..6c87017 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report_3.png b/addons/account_reports_xlsx/static/description/images/account_report_3.png new file mode 100755 index 0000000..91c0ada Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report_3.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report_6.png b/addons/account_reports_xlsx/static/description/images/account_report_6.png new file mode 100755 index 0000000..29c5d8b Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report_6.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report_7.png b/addons/account_reports_xlsx/static/description/images/account_report_7.png new file mode 100755 index 0000000..96105a0 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report_7.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report_8.png b/addons/account_reports_xlsx/static/description/images/account_report_8.png new file mode 100755 index 0000000..2957b12 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report_8.png differ diff --git a/addons/account_reports_xlsx/static/description/images/account_report_9.png b/addons/account_reports_xlsx/static/description/images/account_report_9.png new file mode 100755 index 0000000..050f242 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/account_report_9.png differ diff --git a/addons/account_reports_xlsx/static/description/images/accounting-report.gif b/addons/account_reports_xlsx/static/description/images/accounting-report.gif new file mode 100755 index 0000000..c5d35c3 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/accounting-report.gif differ diff --git a/addons/account_reports_xlsx/static/description/images/accounting_report_4.png b/addons/account_reports_xlsx/static/description/images/accounting_report_4.png new file mode 100755 index 0000000..75abf4e Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/accounting_report_4.png differ diff --git a/addons/account_reports_xlsx/static/description/images/accounting_report_5.png b/addons/account_reports_xlsx/static/description/images/accounting_report_5.png new file mode 100755 index 0000000..b3aea42 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/accounting_report_5.png differ diff --git a/addons/account_reports_xlsx/static/description/images/bank_book.png b/addons/account_reports_xlsx/static/description/images/bank_book.png new file mode 100755 index 0000000..088d9be Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/bank_book.png differ diff --git a/addons/account_reports_xlsx/static/description/images/banner.png b/addons/account_reports_xlsx/static/description/images/banner.png new file mode 100755 index 0000000..60b9433 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/banner.png differ diff --git a/addons/account_reports_xlsx/static/description/images/cash_book.jpeg b/addons/account_reports_xlsx/static/description/images/cash_book.jpeg new file mode 100755 index 0000000..b7a48f2 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/cash_book.jpeg differ diff --git a/addons/account_reports_xlsx/static/description/images/checked.png b/addons/account_reports_xlsx/static/description/images/checked.png new file mode 100755 index 0000000..578cedb Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/checked.png differ diff --git a/addons/account_reports_xlsx/static/description/images/cybrosys.png b/addons/account_reports_xlsx/static/description/images/cybrosys.png new file mode 100755 index 0000000..d76b5ba Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/cybrosys.png differ diff --git a/addons/account_reports_xlsx/static/description/images/day_book_report.png b/addons/account_reports_xlsx/static/description/images/day_book_report.png new file mode 100755 index 0000000..a3fced2 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/day_book_report.png differ diff --git a/addons/account_reports_xlsx/static/description/images/dynamic_financial_report.png b/addons/account_reports_xlsx/static/description/images/dynamic_financial_report.png new file mode 100755 index 0000000..b025b5c Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/dynamic_financial_report.png differ diff --git a/addons/account_reports_xlsx/static/description/images/full_accounting_kit.gif b/addons/account_reports_xlsx/static/description/images/full_accounting_kit.gif new file mode 100755 index 0000000..7c28a18 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/full_accounting_kit.gif differ diff --git a/addons/account_reports_xlsx/static/description/images/project_report.png b/addons/account_reports_xlsx/static/description/images/project_report.png new file mode 100755 index 0000000..3c430a7 Binary files /dev/null and b/addons/account_reports_xlsx/static/description/images/project_report.png differ diff --git a/addons/account_reports_xlsx/static/description/index.html b/addons/account_reports_xlsx/static/description/index.html new file mode 100755 index 0000000..5da7471 --- /dev/null +++ b/addons/account_reports_xlsx/static/description/index.html @@ -0,0 +1,402 @@ +
cybrosys-logo
+
+
+
+ +

Accounting Report Excel

+

Generates XLSX reports for all accounting records of a business.

+
+

Key Highlights

+
    +
  • Partner Ledger Report in Excel Template
  • +
  • General Ledger Report in Excel Template
  • +
  • Balance Sheet Report in Excel Template
  • +
  • Profit and Loss Report in Excel Template
  • +
  • Aged Partner Balance Report in Excel Template
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ Generates xlsx reports for every financial compilation such as Partner Ledger, General Ledger, Balance Sheet, Profit and Loss and Aged Partner Balance. Earlier only pdf reports were made available to the end users of Odoo community. However, these reports were of not much use as they came hard to interpret. +
+
+ The module Accounting Report Excel envisions in giving stress-free accounting experience to the user. Using the module generated XLSX accounting reports, businesses can now seamlessly examine each transaction. The cuser can also print and download the excel reports, making the accounting process more simpler and hassle-free. +

+
+ +

Accounting Report Excel

+
+
    +
  • + + Generates xlsx report for: +
  • + +
  • + + Partner Ledger +
  • + +
  • + + General Ledger +
  • + +
  • + + Balance Sheet +
  • + +
  • + + Profit and Loss +
  • + +
  • + + Aged Partner Balance +
  • +
+
+ +
+
+

Screenshots

+
+
+
+
+
+
+
+
+ +

Video

+
+
+

Accounting Report Excel Demo

+ +
+ Cybrosys Cover Video +
+
+
+ +
+
    +
+
+
+
+
+
+
+

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/addons/account_reports_xlsx/static/src/js/action_manager.js b/addons/account_reports_xlsx/static/src/js/action_manager.js new file mode 100755 index 0000000..15ef8d3 --- /dev/null +++ b/addons/account_reports_xlsx/static/src/js/action_manager.js @@ -0,0 +1,52 @@ +odoo.define('account_reports_xlsx.ActionManager', function (require) { +"use strict"; + +/** + * The purpose of this file is to add the actions of type + * 'ir_actions_xlsx_download' to the ActionManager. + */ + +var ActionManager = require('web.ActionManager'); +var framework = require('web.framework'); +var session = require('web.session'); + +ActionManager.include({ + + /** + * Executes actions of type 'ir_actions_xlsx_download'. + * + * @private + * @param {Object} action the description of the action to execute + * @returns {Deferred} resolved when the report has been downloaded ; + * rejected if an error occurred during the report generation + */ + _executexlsxReportDownloadAction: function (action) { + console.log("ExecutexlsxReportDownloadAction") + console.log(action) + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url: '/xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + error: (error) => this.call('crash_manager', 'rpc_error', error), + complete: framework.unblockUI, + }); + return def; + }, + /** + * Overrides to handle the 'ir_actions_xlsx_download' actions. + * + * @override + * @private + */ + _executeReportAction: function (action, options) { + console.log("inside Execute report action") + if (action.report_type === 'xlsx') { + return this._executexlsxReportDownloadAction(action, options); + } + return this._super.apply(this, arguments); + }, +}); + +}); diff --git a/addons/account_reports_xlsx/views/account_financial_report_data.xml b/addons/account_reports_xlsx/views/account_financial_report_data.xml new file mode 100755 index 0000000..2309c50 --- /dev/null +++ b/addons/account_reports_xlsx/views/account_financial_report_data.xml @@ -0,0 +1,71 @@ + + + + + + Profit and Loss + + -1 + sum + + + + Income + + -1 + + detail_with_hierarchy + account_type + + + + + Expense + + -1 + + detail_with_hierarchy + account_type + + + + + Balance Sheet + sum + + + + Assets + + detail_with_hierarchy + account_type + + + + + Liability + + no_detail + sum + + + + Liability + + detail_with_hierarchy + account_type + + + + + Profit (Loss) to report + + no_detail + account_report + + + + + diff --git a/addons/account_reports_xlsx/views/action_manager.xml b/addons/account_reports_xlsx/views/action_manager.xml new file mode 100755 index 0000000..f5c8f87 --- /dev/null +++ b/addons/account_reports_xlsx/views/action_manager.xml @@ -0,0 +1,9 @@ + + +