diff --git a/trial_balance_pdf/README.rst b/trial_balance_pdf/README.rst new file mode 100755 index 000000000..9447e03b5 --- /dev/null +++ b/trial_balance_pdf/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Trial Balance PDF Report +======================== +This will helps to download the trial Balance PDF Report. + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Chethana Ramachandran, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ + diff --git a/trial_balance_pdf/__init__.py b/trial_balance_pdf/__init__.py new file mode 100644 index 000000000..ec58c446b --- /dev/null +++ b/trial_balance_pdf/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Chethana Ramachandran() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import wizard diff --git a/trial_balance_pdf/__manifest__.py b/trial_balance_pdf/__manifest__.py new file mode 100644 index 000000000..35c85542a --- /dev/null +++ b/trial_balance_pdf/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Chethana Ramachandran() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Trial Balance PDF Report", + 'version': '16.0.1.0.0', + 'category': "Accounting", + 'summary': """This module will helps to get the trial balance report in + PDF format""", + 'description': """The module provides a pdf report of the trial balance in + the Odoo Community Version's Accounting App.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'account'], + 'data': [ + 'security/ir.model.access.csv', + 'report/trial_balance_report.xml', + 'wizard/trial_balance_report_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/trial_balance_pdf/doc/RELEASE_NOTES.md b/trial_balance_pdf/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..451159269 --- /dev/null +++ b/trial_balance_pdf/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 25.07.2023 +#### Version 16.0.1.0.0 +##### ADD +- Initial commit for Trial Balance PDF Report + diff --git a/trial_balance_pdf/report/trial_balance_report.xml b/trial_balance_pdf/report/trial_balance_report.xml new file mode 100644 index 000000000..00459c96e --- /dev/null +++ b/trial_balance_pdf/report/trial_balance_report.xml @@ -0,0 +1,111 @@ + + + + + + + Trial Balance + trial.balance.report + qweb-pdf + trial_balance_pdf.report_trial_balance + trial_balance_pdf.report_trial_balance + + report + + + + diff --git a/trial_balance_pdf/security/ir.model.access.csv b/trial_balance_pdf/security/ir.model.access.csv new file mode 100644 index 000000000..75e9b200d --- /dev/null +++ b/trial_balance_pdf/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_trial_balance_report,access.trial.balance.report,model_trial_balance_report,base.group_user,1,1,1,1 diff --git a/trial_balance_pdf/static/description/assets/icons/check.png b/trial_balance_pdf/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/check.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/chevron.png b/trial_balance_pdf/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/chevron.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/cogs.png b/trial_balance_pdf/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/cogs.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/consultation.png b/trial_balance_pdf/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/consultation.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/ecom-black.png b/trial_balance_pdf/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/ecom-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/education-black.png b/trial_balance_pdf/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/education-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/hotel-black.png b/trial_balance_pdf/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/hotel-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/license.png b/trial_balance_pdf/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/license.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/lifebuoy.png b/trial_balance_pdf/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/lifebuoy.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/manufacturing-black.png b/trial_balance_pdf/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/manufacturing-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/pos-black.png b/trial_balance_pdf/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/pos-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/puzzle.png b/trial_balance_pdf/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/puzzle.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/restaurant-black.png b/trial_balance_pdf/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/restaurant-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/service-black.png b/trial_balance_pdf/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/service-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/trading-black.png b/trial_balance_pdf/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/trading-black.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/training.png b/trial_balance_pdf/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/training.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/update.png b/trial_balance_pdf/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/update.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/user.png b/trial_balance_pdf/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/user.png differ diff --git a/trial_balance_pdf/static/description/assets/icons/wrench.png b/trial_balance_pdf/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/trial_balance_pdf/static/description/assets/icons/wrench.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/categories.png b/trial_balance_pdf/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/categories.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/check-box.png b/trial_balance_pdf/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/check-box.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/compass.png b/trial_balance_pdf/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/compass.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/corporate.png b/trial_balance_pdf/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/corporate.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/customer-support.png b/trial_balance_pdf/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/customer-support.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/cybrosys-logo.png b/trial_balance_pdf/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/cybrosys-logo.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/features.png b/trial_balance_pdf/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/features.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/logo.png b/trial_balance_pdf/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/logo.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/pictures.png b/trial_balance_pdf/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/pictures.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/pie-chart.png b/trial_balance_pdf/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/pie-chart.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/right-arrow.png b/trial_balance_pdf/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/right-arrow.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/star.png b/trial_balance_pdf/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/star.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/support.png b/trial_balance_pdf/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/support.png differ diff --git a/trial_balance_pdf/static/description/assets/misc/whatsapp.png b/trial_balance_pdf/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/misc/whatsapp.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img1.png b/trial_balance_pdf/static/description/assets/modules/img1.png new file mode 100644 index 000000000..1c98e213f Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img1.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img2.png b/trial_balance_pdf/static/description/assets/modules/img2.png new file mode 100644 index 000000000..99298bf4b Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img2.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img3.png b/trial_balance_pdf/static/description/assets/modules/img3.png new file mode 100644 index 000000000..d2f60e3d3 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img3.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img4.png b/trial_balance_pdf/static/description/assets/modules/img4.png new file mode 100644 index 000000000..29a17f2be Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img4.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img5.png b/trial_balance_pdf/static/description/assets/modules/img5.png new file mode 100644 index 000000000..c0aa245ce Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img5.png differ diff --git a/trial_balance_pdf/static/description/assets/modules/img6.png b/trial_balance_pdf/static/description/assets/modules/img6.png new file mode 100644 index 000000000..216c130e0 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/modules/img6.png differ diff --git a/trial_balance_pdf/static/description/assets/screenshots/hero.gif b/trial_balance_pdf/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..b4a2c1404 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/screenshots/hero.gif differ diff --git a/trial_balance_pdf/static/description/assets/screenshots/img.png b/trial_balance_pdf/static/description/assets/screenshots/img.png new file mode 100644 index 000000000..fb3b166a7 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/screenshots/img.png differ diff --git a/trial_balance_pdf/static/description/assets/screenshots/img1.png b/trial_balance_pdf/static/description/assets/screenshots/img1.png new file mode 100644 index 000000000..62dbde324 Binary files /dev/null and b/trial_balance_pdf/static/description/assets/screenshots/img1.png differ diff --git a/trial_balance_pdf/static/description/assets/screenshots/img2.png b/trial_balance_pdf/static/description/assets/screenshots/img2.png new file mode 100644 index 000000000..6e905c33e Binary files /dev/null and b/trial_balance_pdf/static/description/assets/screenshots/img2.png differ diff --git a/trial_balance_pdf/static/description/banner.png b/trial_balance_pdf/static/description/banner.png new file mode 100644 index 000000000..a7c7265f2 Binary files /dev/null and b/trial_balance_pdf/static/description/banner.png differ diff --git a/trial_balance_pdf/static/description/icon.png b/trial_balance_pdf/static/description/icon.png new file mode 100644 index 000000000..b03f79d4f Binary files /dev/null and b/trial_balance_pdf/static/description/icon.png differ diff --git a/trial_balance_pdf/static/description/index.html b/trial_balance_pdf/static/description/index.html new file mode 100644 index 000000000..27e372614 --- /dev/null +++ b/trial_balance_pdf/static/description/index.html @@ -0,0 +1,546 @@ +
+ +
+ +
+
+ Community +
+
+
+ + + +

Trial Balance PDF Report

+

This app allows you to download the trial balance pdf report.

+ + + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This app allows you to download the trial balance pdf report in the Accounting Module. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ +
+ +

+ Easy to Download

+

+ You can easily download the trail balance report in PDF Format. +

+
+
+
+
+ +
+ +

+ Report in different Filter

+

+ You can apply the filter to download the report. +

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

Screenshots +

+
+
+
+ +
+

You can see the option in Reporting Tab. By Clicking the option a wizard will open.

+ +
+
+
+ +
+

You can apply the filters that you want in the wizard.

+ +
+
+
+ +
+

After Clicking the PDF button, You will get the PDF Report.

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

Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/trial_balance_pdf/wizard/__init__.py b/trial_balance_pdf/wizard/__init__.py new file mode 100644 index 000000000..5a517c338 --- /dev/null +++ b/trial_balance_pdf/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Chethana Ramachandran() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import trial_balance_report diff --git a/trial_balance_pdf/wizard/trial_balance_report.py b/trial_balance_pdf/wizard/trial_balance_report.py new file mode 100644 index 000000000..3e05fb21c --- /dev/null +++ b/trial_balance_pdf/wizard/trial_balance_report.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Chethana Ramachandran() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + +selection_field = {'posted': 'Posted Entries only', + 'draft': 'Include UnPosted Entries'} + + +class TrialBalanceReport(models.TransientModel): + """Create new model""" + _name = 'trial.balance.report' + _description = 'trial balance report' + + start_date = fields.Date(string="Start Date", + help="Select start date to fetch the trial " + "balance data") + end_date = fields.Date(string="End Date", + help="Select end date to fetch the trial " + "balance data") + journals_ids = fields.Many2many('account.journal', string="Journals", + help="Select the journals to added in the" + "trail balance") + company_id = fields.Many2one('res.company', string="Company", + help="Select the company of the journals", + default=lambda self: self.env.company) + state = fields.Selection([ + ('posted', 'Posted Entries only'), + ('draft', 'Include UnPosted Entries'), + ], tracking=True, string="State", help="Select the state of journal " + "entries which we want to report") + + def button_to_get_pdf(self): + """It will create the report using defined query""" + where_conditions = [] + parameters = [] + state_value = "" + currency = self.env.user.company_id.currency_id.symbol + if self.start_date: + where_conditions.append("account_move_line.date >= %s") + parameters.append(self.start_date) + if self.end_date: + where_conditions.append("account_move_line.date <= %s") + parameters.append(self.end_date) + if self.company_id: + where_conditions.append("account_move_line.company_id = %s") + parameters.append(str(self.company_id.id)) + if self.state == 'posted': + where_conditions.append("parent_state = 'posted'") + if self.state == 'draft': + where_conditions.append("parent_state in ('posted', 'draft')") + if self.journals_ids: + journal_ids = [journal.id for journal in self.journals_ids] + where_conditions.append("journal_id IN %s") + parameters.append(tuple(journal_ids)) + where_query = " AND ".join(where_conditions) + query = """ + SELECT + account_account.code AS code, + account_account.name AS ac_name, + SUM(account_move_line.debit) AS debit, + SUM(account_move_line.credit) AS credit, + SUM(account_move_line.debit) - SUM(account_move_line.credit) AS + balance + FROM + account_move_line + JOIN + account_account ON account_account.id = + account_move_line.account_id + {} + GROUP BY + account_id, + account_account.name, + account_account.code + """.format("WHERE " + where_query if where_conditions else "") + self.env.cr.execute(query, tuple(parameters)) + main_query = self.env.cr.dictfetchall() + total_credit = 0.0 + total_debit = 0.0 + for rec in main_query: + total_credit += rec['credit'] + total_debit += rec['debit'] + balance = total_debit - total_credit + if self.state: + state_value = selection_field[self.state] + journals = str(self.journals_ids.mapped('name')) + result = journals[1:-1].replace("'", "") + data = { + 'query': main_query, + 'start_date': self.start_date, + 'end_date': self.end_date, + 'total_credit': round(total_credit, 2), + 'total_debit': round(total_debit, 2), + 'balance': round(balance), + 'currency': currency, + 'state': state_value, + 'journals_name': result + } + return self.env.ref( + 'trial_balance_pdf.action_report_trial_balance').report_action( + self, data=data) diff --git a/trial_balance_pdf/wizard/trial_balance_report_view.xml b/trial_balance_pdf/wizard/trial_balance_report_view.xml new file mode 100644 index 000000000..853c5ef4d --- /dev/null +++ b/trial_balance_pdf/wizard/trial_balance_report_view.xml @@ -0,0 +1,45 @@ + + + + + trial.balance.report.view.form + trial.balance.report + +
+ + + + + + + + + + + +
+
+
+
+
+ + + Trial Balance Report + trial.balance.report + list,form + + new + + + + + +
\ No newline at end of file