diff --git a/advance_cash_flow_statements/README.rst b/advance_cash_flow_statements/README.rst new file mode 100644 index 000000000..41655b3ad --- /dev/null +++ b/advance_cash_flow_statements/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Advanced Cash Flow Statements +============================== +Generate 4 levels of Dynamic Cash Flow Statements Report. + +Configuration +============= +No configuration + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Mily Shajan , + (v17) Gayathri V, + (V18) Abbas P , +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/advance_cash_flow_statements/__init__.py b/advance_cash_flow_statements/__init__.py new file mode 100644 index 000000000..5c422802c --- /dev/null +++ b/advance_cash_flow_statements/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import controllers +from . import models +from . import wizard diff --git a/advance_cash_flow_statements/__manifest__.py b/advance_cash_flow_statements/__manifest__.py new file mode 100644 index 000000000..bf48e3581 --- /dev/null +++ b/advance_cash_flow_statements/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Advanced Cash Flow Statements', + 'version': '18.0.1.0.0', + 'summary': """Generate four levels of cash flow statement reports""", + 'description': """Generate four hierarchical levels of cash flow statements + and provide options to print reports in both PDF and XLSX + formats for analysis.""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Accounting', + 'depends': ['base', 'account'], + 'data': ['security/ir.model.access.csv', + 'report/account_wizard_reports.xml', + 'report/account_wizard_templates.xml', + 'views/account_wizard_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'advance_cash_flow_statements/static/src/js/action_manager.js' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/advance_cash_flow_statements/controllers/__init__.py b/advance_cash_flow_statements/controllers/__init__.py new file mode 100644 index 000000000..d5578b01f --- /dev/null +++ b/advance_cash_flow_statements/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import advance_cash_flow_statements diff --git a/advance_cash_flow_statements/controllers/advance_cash_flow_statements.py b/advance_cash_flow_statements/controllers/advance_cash_flow_statements.py new file mode 100644 index 000000000..76098fa58 --- /dev/null +++ b/advance_cash_flow_statements/controllers/advance_cash_flow_statements.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +from odoo import http +from odoo.http import content_disposition, request +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """ Generates an XLSX report. """ + @http.route('/cash_flow_xlsx_reports', type='http', auth='user', + methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, report_name): + """ Generates an XLSX report. """ + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + options = json.loads(options) + token = 'dummy-because-api-expects-one' + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[ + ('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', content_disposition( + report_name + '.xlsx')) + ] + ) + report_obj.get_xlsx_report(options, response) + response.set_cookie('fileToken', token) + return response + except Exception as e: + se = http.serialize_exception(e) + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': se + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/advance_cash_flow_statements/doc/RELEASE_NOTES.md b/advance_cash_flow_statements/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..cac41c0f8 --- /dev/null +++ b/advance_cash_flow_statements/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 31.05.2025 +#### Version 18.0.1.0.0 +##### ADD +- Initial commit for Advanced Cash Flow Statements diff --git a/advance_cash_flow_statements/models/__init__.py b/advance_cash_flow_statements/models/__init__.py new file mode 100644 index 000000000..3690d8c2d --- /dev/null +++ b/advance_cash_flow_statements/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import account_report diff --git a/advance_cash_flow_statements/models/account_report.py b/advance_cash_flow_statements/models/account_report.py new file mode 100644 index 000000000..de41a3cc9 --- /dev/null +++ b/advance_cash_flow_statements/models/account_report.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, models, fields +from odoo.tools.misc import get_lang + + +class AccountReport(models.Model): + _inherit = "account.report" + _description = "Account Common Report" + """This is used to inherit account report to add more fields and + functions""" + + company_id = fields.Many2one('res.company', string='Company', required=True, + readonly=True, + default=lambda self: self.env.company, + help='default Company') + journal_ids = fields.Many2many( + comodel_name='account.journal', + string='Journals', + required=True, + default=lambda self: self.env['account.journal'].search( + [('company_id', '=', self.company_id.id)]), + domain="[('company_id', '=', company_id)]", help='Gives the journal of ' + 'the default company') + date_from = fields.Date(string='Start Date', + help='Date at which report need to be start') + date_to = fields.Date(string='End Date', + help='Date at which report need to be End') + target_move = fields.Selection([('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves', required=True, + default='posted', help='Type of entries') + + @api.onchange('company_id') + def _onchange_company_id(self): + """ Fetch the journal values based on company""" + if self.company_id: + self.journal_ids = self.env['account.journal'].search( + [('company_id', '=', self.company_id.id)]) + else: + self.journal_ids = self.env['account.journal'].search([]) + + def _build_contexts(self, data): + """ Pass the context values for report""" + result = {} + result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][ + 'journal_ids'] or False + result['state'] = 'target_move' in data['form'] and data['form'][ + 'target_move'] or '' + result['date_from'] = data['form']['date_from'] or False + result['date_to'] = data['form']['date_to'] or False + result['strict_range'] = True if result['date_from'] else False + result['company_id'] = data['form']['company_id'][0] or False + return result + + def _print_report(self, data): + """ Report print action""" + raise NotImplementedError() + + def check_report(self): + """ Return the values for report""" + self.ensure_one() + data = {'ids': self.env.context.get('active_ids', []), + 'model': self.env.context.get('active_model', 'ir.ui.menu'), + 'form': self.read( + ['date_from', 'date_to', 'journal_ids', 'target_move', + 'company_id'])[0]} + used_context = self._build_contexts(data) + data['form']['used_context'] = dict(used_context, + lang=get_lang(self.env).code) + return self.with_context(discard_logo_check=True)._print_report(data) diff --git a/advance_cash_flow_statements/report/account_wizard_reports.xml b/advance_cash_flow_statements/report/account_wizard_reports.xml new file mode 100644 index 000000000..c187dab4f --- /dev/null +++ b/advance_cash_flow_statements/report/account_wizard_reports.xml @@ -0,0 +1,11 @@ + + + + + Cash flow statement Pdf Report + account.wizard + qweb-pdf + advance_cash_flow_statements.cash_flow_pdf_report + advance_cash_flow_statements.cash_flow_pdf_report + + diff --git a/advance_cash_flow_statements/report/account_wizard_templates.xml b/advance_cash_flow_statements/report/account_wizard_templates.xml new file mode 100644 index 000000000..5324bc603 --- /dev/null +++ b/advance_cash_flow_statements/report/account_wizard_templates.xml @@ -0,0 +1,233 @@ + + + + + diff --git a/advance_cash_flow_statements/security/ir.model.access.csv b/advance_cash_flow_statements/security/ir.model.access.csv new file mode 100644 index 000000000..b7a5b4683 --- /dev/null +++ b/advance_cash_flow_statements/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_account_wizard_user,account.wizard.user,model_account_wizard,base.group_user,1,1,1,1 diff --git a/advance_cash_flow_statements/static/description/assets/cybro-icon.png b/advance_cash_flow_statements/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/cybro-icon.png differ diff --git a/advance_cash_flow_statements/static/description/assets/cybro-odoo.png b/advance_cash_flow_statements/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/cybro-odoo.png differ diff --git a/advance_cash_flow_statements/static/description/assets/h2.png b/advance_cash_flow_statements/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/h2.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/arrows-repeat.svg b/advance_cash_flow_statements/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-1.png b/advance_cash_flow_statements/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/banner-1.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-2.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-bg.png b/advance_cash_flow_statements/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/banner-bg.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-bg.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-call.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-mail.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-pattern.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/banner-promo.svg b/advance_cash_flow_statements/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/brand-pair.svg b/advance_cash_flow_statements/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/check.png b/advance_cash_flow_statements/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/check.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/chevron.png b/advance_cash_flow_statements/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/chevron.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/close-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/cogs.png b/advance_cash_flow_statements/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/cogs.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/collabarate-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/consultation.png b/advance_cash_flow_statements/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/consultation.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/cybro-logo.png b/advance_cash_flow_statements/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/cybro-logo.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/down.svg b/advance_cash_flow_statements/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/advance_cash_flow_statements/static/description/assets/icons/ecom-black.png b/advance_cash_flow_statements/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/ecom-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/education-black.png b/advance_cash_flow_statements/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/education-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/faq.png b/advance_cash_flow_statements/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/faq.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/feature-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/feature.png b/advance_cash_flow_statements/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/feature.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/gear.svg b/advance_cash_flow_statements/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/hero.gif b/advance_cash_flow_statements/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..b350dfdc7 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/hero.gif differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/hire-odoo.svg b/advance_cash_flow_statements/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/hotel-black.png b/advance_cash_flow_statements/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/hotel-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/license.png b/advance_cash_flow_statements/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/license.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/life-ring-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/lifebuoy.png b/advance_cash_flow_statements/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/lifebuoy.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/mail.svg b/advance_cash_flow_statements/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/manufacturing-black.png b/advance_cash_flow_statements/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/manufacturing-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/notes.png b/advance_cash_flow_statements/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/notes.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/notification icon.svg b/advance_cash_flow_statements/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/odoo-consultancy.svg b/advance_cash_flow_statements/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/odoo-licencing.svg b/advance_cash_flow_statements/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/odoo-logo.png b/advance_cash_flow_statements/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/odoo-logo.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/patter.svg b/advance_cash_flow_statements/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/pattern1.png b/advance_cash_flow_statements/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/pattern1.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/pos-black.png b/advance_cash_flow_statements/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/pos-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/puzzle-piece-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/puzzle.png b/advance_cash_flow_statements/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/puzzle.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/replace-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/restaurant-black.png b/advance_cash_flow_statements/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/restaurant-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/screenshot-main.png b/advance_cash_flow_statements/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/screenshot-main.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/screenshot.png b/advance_cash_flow_statements/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/screenshot.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/service-black.png b/advance_cash_flow_statements/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/service-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/skype-fill.svg b/advance_cash_flow_statements/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/skype.png b/advance_cash_flow_statements/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/skype.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/skype.svg b/advance_cash_flow_statements/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/star-1.svg b/advance_cash_flow_statements/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/star-2.svg b/advance_cash_flow_statements/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/support.png b/advance_cash_flow_statements/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/support.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/test-1 - Copy.png b/advance_cash_flow_statements/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/test-1 - Copy.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/test-1.png b/advance_cash_flow_statements/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/test-1.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/test-2.png b/advance_cash_flow_statements/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/test-2.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/trading-black.png b/advance_cash_flow_statements/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/trading-black.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/training.png b/advance_cash_flow_statements/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/training.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/translate.svg b/advance_cash_flow_statements/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/update.png b/advance_cash_flow_statements/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/update.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/user.png b/advance_cash_flow_statements/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/user.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/video.png b/advance_cash_flow_statements/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/video.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/whatsapp.png b/advance_cash_flow_statements/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/whatsapp.png differ diff --git a/advance_cash_flow_statements/static/description/assets/icons/wrench-icon.svg b/advance_cash_flow_statements/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/advance_cash_flow_statements/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/advance_cash_flow_statements/static/description/assets/icons/wrench.png b/advance_cash_flow_statements/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/icons/wrench.png differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/1.jpg b/advance_cash_flow_statements/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/1.jpg differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/2.jpg b/advance_cash_flow_statements/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/2.jpg differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/3.jpg b/advance_cash_flow_statements/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/3.jpg differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/4.png b/advance_cash_flow_statements/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/4.png differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/5.jpg b/advance_cash_flow_statements/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/5.jpg differ diff --git a/advance_cash_flow_statements/static/description/assets/modules/6.gif b/advance_cash_flow_statements/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/modules/6.gif differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss1.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss1.png new file mode 100644 index 000000000..bb7f9bcd3 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss1.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss10.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss10.png new file mode 100644 index 000000000..1a27fcd16 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss10.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss2.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss2.png new file mode 100644 index 000000000..e784e2b49 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss2.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss3.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss3.png new file mode 100644 index 000000000..db43d5277 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss3.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss4.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss4.png new file mode 100644 index 000000000..d88331e67 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss4.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss5.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss5.png new file mode 100644 index 000000000..8bb72be43 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss5.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss6.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss6.png new file mode 100644 index 000000000..9b0111dda Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss6.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss7.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss7.png new file mode 100644 index 000000000..63c0ea456 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss7.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss8.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss8.png new file mode 100644 index 000000000..97f0c2f88 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss8.png differ diff --git a/advance_cash_flow_statements/static/description/assets/screenshots/ss9.png b/advance_cash_flow_statements/static/description/assets/screenshots/ss9.png new file mode 100644 index 000000000..d797f17ba Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/screenshots/ss9.png differ diff --git a/advance_cash_flow_statements/static/description/assets/y18.jpg b/advance_cash_flow_statements/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/advance_cash_flow_statements/static/description/assets/y18.jpg differ diff --git a/advance_cash_flow_statements/static/description/banner.jpg b/advance_cash_flow_statements/static/description/banner.jpg new file mode 100644 index 000000000..745b4163a Binary files /dev/null and b/advance_cash_flow_statements/static/description/banner.jpg differ diff --git a/advance_cash_flow_statements/static/description/icon.png b/advance_cash_flow_statements/static/description/icon.png new file mode 100644 index 000000000..86e9805a9 Binary files /dev/null and b/advance_cash_flow_statements/static/description/icon.png differ diff --git a/advance_cash_flow_statements/static/description/index.html b/advance_cash_flow_statements/static/description/index.html new file mode 100644 index 000000000..4e88ce3f9 --- /dev/null +++ b/advance_cash_flow_statements/static/description/index.html @@ -0,0 +1,1143 @@ + + + + + + Advanced Cash Flow Statements + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ +
+
+ +
+
+
+
+

+ Generate four levels of cash flow statements. Print reports in both PDF and XLSX formats. +

+

Advanced Cash Flow Statements +

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

Key + Highlights

+
+
+
+
+ +
+
+ Levels of Cash Flow +
+

+ Generate four levels of cash flow statements.

+ + +
+
+
+
+
+ +
+
+ Print reports in both PDF and XLSX formats + + +
+

It gives four levels reports in both formats

+ +
+
+
+
+ +
+
+
+ Advanced Cash Flow Statements +

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

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

+ Access Advanced Cash Flow from the Menu + +

+
+
+

+ Go to Invoicing --> Reporting --> Financial Reports --> Adv Cash Flow Statement. +

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

+ Cash Flow Report in PDF and Excel +

+
+ +
+
+
+

+

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

+ Cash Flow Statement Summary PDF +

+

+ +

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

+ Cash Flow Statement Summary Excel +

+

+

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

+ Cash flow Statement Consolidated PDF Report. + +

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

+ Cash Flow Statement Consolidated Excel + +

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

+ Cash flow Statement Detailed PDF Report +

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

+ Cash flow Statement Detailed Excel Report +

+
+
+

+

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

+ Cash flow Statement Very Detailed PDF Report. + +

+
+
+

+

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

+ Cash flow Statement Very Detailed Excel Report. + +

+
+
+

+

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

Based on the chosen date + gives four levels of cash flow

+
+
+
+
+
+
+
+ +
+

Analysing of Cash flow as + more easier

+
+
+
+
+
+
+
+ +
+

Summary : Month wise cash flow report.

+
+
+
+
+
+
+
+ +
+

Consolidated : Report based on the cash flow affected accounts.

+
+
+
+
+
+
+
+ +
+

Detailed : Report based on the cash flow affected accounts.

+
+
+
+
+
+
+
+ +
+

Very Detailed : Report shows the cash flow affected account,corresponding journal entries + and its move lines

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

+ Yes, any employee whose image is set in the employee profile + and is selected in the POS configuration settings can use + Face Recognition for login. +

+
+
+ +
+ +
+

+ If the system fails to recognize the employee's face, + login will not be allowed, and the employee may need to + retry after setting latest image in the Employee module. +

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

+ Latest Release 18.0.1.0.0 +

+ + 31 May, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + \ No newline at end of file diff --git a/advance_cash_flow_statements/static/src/js/action_manager.js b/advance_cash_flow_statements/static/src/js/action_manager.js new file mode 100644 index 000000000..7465b1b14 --- /dev/null +++ b/advance_cash_flow_statements/static/src/js/action_manager.js @@ -0,0 +1,17 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { BlockUI } from "@web/core/ui/block_ui"; +import { download } from "@web/core/network/download"; + +// This function is responsible for generating and downloading an XLSX report. +registry.category("ir.actions.report handlers").add("xlsx", async function (action){ + if (action.report_type === 'xlsx') { + const blockUI = new BlockUI(); + await download({ + url: '/cash_flow_xlsx_reports', + data: action.data, + complete: () => unblockUI, + error: (error) => self.call('crash_manager', 'rpc_error', error), + }); + } +}); diff --git a/advance_cash_flow_statements/views/account_wizard_views.xml b/advance_cash_flow_statements/views/account_wizard_views.xml new file mode 100644 index 000000000..94ae6d3b7 --- /dev/null +++ b/advance_cash_flow_statements/views/account_wizard_views.xml @@ -0,0 +1,52 @@ + + + + + account.wizard.form.view + account.wizard + +
+ + + + + + + + + + +
+
+
+
+
+ + + Cash Flow Statements + ir.actions.act_window + account.wizard + + form + new + + + + +
diff --git a/advance_cash_flow_statements/wizard/__init__.py b/advance_cash_flow_statements/wizard/__init__.py new file mode 100644 index 000000000..c7efc392e --- /dev/null +++ b/advance_cash_flow_statements/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import account_wizard +from . import report_account_wizard diff --git a/advance_cash_flow_statements/wizard/account_wizard.py b/advance_cash_flow_statements/wizard/account_wizard.py new file mode 100644 index 000000000..8734b4bb4 --- /dev/null +++ b/advance_cash_flow_statements/wizard/account_wizard.py @@ -0,0 +1,466 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +import json +from datetime import datetime +from odoo import models, fields, _ +from odoo.exceptions import UserError +from odoo.tools import json_default +import io + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class AccountWizard(models.TransientModel): + _name = "account.wizard" + _description = 'Account Wizard' + + name = fields.Char(default="Invoice", help='Name of Invoice ') + date_from = fields.Date(string="Start Date", required=True, + help='Date at which report need to be start') + date_to = fields.Date(string="End Date", default=fields.Date.today, + required=True, + help='Date at which report need to be end') + today = fields.Date("Report Date", default=fields.Date.today, + help='Date at which report is generated') + levels = fields.Selection([('summary', 'Summary'), + ('consolidated', 'Consolidated'), + ('detailed', 'Detailed'), + ('very', 'Very Detailed')], + string='Levels', required=True, default='summary', + help='Different levels for cash flow statements\n' + 'Summary: Month wise report.\n' + 'Consolidated: Based on account types.\n' + 'Detailed: Based on accounts.\n' + 'Very Detailed: Accounts with their move lines') + target_move = fields.Selection([('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves', required=True, + default='posted', help='Type of entries') + + def generate_pdf_report(self): + """ Generate the pdf reports and return values to template""" + self.ensure_one() + logged_users = self.env['res.company']._company_default_get( + 'account.account') + if self.date_from: + if self.date_from > self.date_to: + raise UserError(_("Start date should be less than end date")) + data = { + 'ids': self.ids, + 'model': self._name, + 'date_from': self.date_from, + 'date_to': self.date_to, + 'levels': self.levels, + 'target_move': self.target_move, + 'today': self.today, + 'logged_users': logged_users.name, + } + return self.env.ref( + 'advance_cash_flow_statements.pdf_report_action').report_action( + self, + data=data) + + def generate_xlsx_report(self): + """ Generate xlsx report return values to template""" + date_from = datetime.strptime(str(self.date_from), "%Y-%m-%d") + date_to = datetime.strptime(str(self.date_to), "%Y-%m-%d") + if date_from: + if date_from > date_to: + raise UserError(_("Start date should be less than end date")) + data = { + 'ids': self.ids, + 'model': self._name, + 'date_from': self.date_from, + 'date_to': self.date_to, + 'levels': self.levels, + 'target_move': self.target_move, + 'today': self.today, + } + return { + 'type': 'ir.actions.report', + 'report_type': 'xlsx', + 'data': {'model': 'account.wizard', + 'output_format': 'xlsx', + 'options': json.dumps(data, + default=json_default), + 'report_name': 'Adv Cash Flow Statement', + }, + } + + def get_xlsx_report(self, data, response): + """ Update the xlsx template and pass values to templates""" + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + fetched_data = [] + account_res = [] + journal_res = [] + fetched = [] + currency_symbol = self.env.user.company_id.currency_id.symbol + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + if data['levels'] == 'summary': + query = f""" + SELECT + to_char(am.date, 'Month') as month_part, + EXTRACT(YEAR FROM am.date) as year_part, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY month_part, year_part + """ + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = cr.dictfetchall() + elif data['levels'] == 'consolidated': + query = f""" + SELECT aa.id, + aa.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.id, aa.name + """ + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = cr.dictfetchall() + elif data['levels'] == 'detailed': + query = f""" + SELECT aa.id, + aa.name as name, + aa.code_store, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.id, aa.name, aa.code_store + """ + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = cr.dictfetchall() + for account in self.env['account.account'].search([]): + child_lines = self._get_journal_lines(account, data) + if child_lines: + journal_res.append(child_lines) + else: + query = f""" + SELECT + aa.name as name, + aa.code_store, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.name, aa.code_store + """ + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'])) + fetched = cr.dictfetchall() + for account in self.env['account.account'].search([]): + child_lines = self._get_lines(account, data) + if child_lines: + account_res.append(child_lines) + + logged_users = self.env['res.company']._company_default_get( + 'account.account') + sheet = workbook.add_worksheet() + bold = workbook.add_format({'align': 'center', + 'bold': True, + 'font_size': '10px', + 'border': 1}) + date = workbook.add_format({'font_size': '10px'}) + cell_format = workbook.add_format({'bold': True, + 'font_size': '10px'}) + head = workbook.add_format({'align': 'center', + 'bold': True, + 'bg_color': '#D3D3D3', + 'font_size': '15px'}) + txt = workbook.add_format({'align': 'left', + 'font_size': '10px'}) + txt_left = workbook.add_format({'align': 'left', + 'font_size': '10px', + 'border': 1}) + txt_center = workbook.add_format({'align': 'center', + 'font_size': '10px', + 'border': 1}) + amount = workbook.add_format({'align': 'right', + 'font_size': '10px', + 'border': 1}) + amount_bold = workbook.add_format({'align': 'right', + 'bold': True, + 'font_size': '10px', + 'border': 1}) + txt_bold = workbook.add_format({'align': 'left', + 'bold': True, + 'font_size': '10px', + 'border': 1}) + + sheet.set_column('C:C', 30, cell_format) + sheet.set_column('D:E', 20, cell_format) + sheet.set_column('F:F', 20, cell_format) + sheet.write('C2', "Report Date", txt) + sheet.write('D2', str(data['today']), txt) + sheet.write('F2', logged_users.name, txt) + sheet.merge_range('C3:F4', 'CASH FLOW STATEMENTS', head) + + if data['target_move'] == 'posted': + sheet.write('C6', "Target Moves :", cell_format) + sheet.write('C7', 'All Posted Entries', date) + else: + sheet.write('C6', "Target Moves :", cell_format) + sheet.write('C7', 'All Entries', date) + + sheet.write('D6', "Date From", cell_format) + sheet.write('E6', str(data['date_from']), date) + sheet.write('D7', "Date To", cell_format) + sheet.write('E7', str(data['date_to']), date) + + sheet.merge_range('C8:F8', '', head) + sheet.write('C9', 'NAME', bold) + sheet.write('D9', 'CASH IN', bold) + sheet.write('E9', 'CASH OUT', bold) + sheet.write('F9', 'BALANCE', bold) + + row_num = 8 + col_num = 2 + fetched_data_list = fetched_data.copy() + account_res_list = account_res.copy() + journal_res_list = journal_res.copy() + fetched_list = fetched.copy() + filtered_fetched_data_list = [entry for entry in fetched_data_list if + None not in entry.values()] + for i in filtered_fetched_data_list: + if data['levels'] == 'summary': + sheet.write(row_num + 1, col_num, + str(i['month_part']) + str(int(i['year_part'])), + txt_left) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(i['total_debit']), + amount) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(i['total_credit']), + amount) + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(i['total_debit'] - i['total_credit']), + amount) + row_num = row_num + 1 + elif data['levels'] == 'consolidated': + acc = self.env['account.account'].browse(i['id']) + sheet.write(row_num + 1, col_num, acc.name, txt_left) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(i['total_debit']), + amount) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(i['total_credit']), + amount) + if i['total_credit'] and i['total_credit']: + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(i['total_debit'] - i['total_credit']), + amount) + else: + sheet.write(row_num + 1, col_num + 3, + str(0) + str(currency_symbol), + amount) + row_num = row_num + 1 + + for j in journal_res_list: + for k in filtered_fetched_data_list: + account_name = self.env['account.account'].browse(k['id']) + if account_name.name == j['account']: + sheet.write(row_num + 1, col_num, + str(", ".join(k['code_store'].values())) + str(account_name.name), + txt_bold) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(k['total_debit']), + amount_bold) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(k['total_credit']), + amount_bold) + if k['total_debit'] and k['total_credit']: + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(k['total_debit'] - k[ + 'total_credit']), amount_bold) + else: + sheet.write(row_num + 1, col_num + 3, + str(0) + str( + currency_symbol), amount_bold) + row_num = row_num + 1 + for l in j['journal_lines']: + acc = self.env['account.account'].browse(l['id']) + sheet.write(row_num + 1, col_num, acc.name, txt_left) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(l['total_debit']), + amount) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(l['total_credit']), + amount) + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(l['total_debit'] - l['total_credit']), + amount) + row_num = row_num + 1 + + for j in account_res_list: + for k in fetched_list: + + if k['name'] == j['account']: + sheet.write(row_num + 1, col_num, + str(", ".join(k['code_store'].values())) + str(k['name']), txt_bold) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(k['total_debit']), + amount_bold) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(k['total_credit']), + amount_bold) + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(k['total_debit'] - k['total_credit']), amount_bold) + row_num = row_num + 1 + for l in j['journal_lines']: + if l['account_name'] == j['account']: + sheet.write(row_num + 1, col_num, l['name'], txt_left) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(l['total_debit']), + amount) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(l['total_credit']), + amount) + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(l['total_debit'] - l['total_credit']), + amount) + row_num = row_num + 1 + for m in j['move_lines']: + if m['name'] == l['name']: + sheet.write(row_num + 1, col_num, m['move_name'], + txt_center) + sheet.write(row_num + 1, col_num + 1, + str(currency_symbol) + '{:.2f}'.format(m['total_debit']), amount) + sheet.write(row_num + 1, col_num + 2, + str(currency_symbol) + '{:.2f}'.format(m['total_credit']), amount) + sheet.write(row_num + 1, col_num + 3, + str(currency_symbol) + '{:.2f}'.format(m['total_debit'] - m[ + 'total_credit']), + amount) + row_num = row_num + 1 + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() + + def _get_lines(self, account, data): + """ Fetch values for lines""" + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + query = f""" + SELECT + aml.account_id, + aj.name as name, + am.name as move_name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY am.name, aml.account_id, aj.name + """ + + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'], account.id)) + fetched_data = cr.dictfetchall() + + query2 = f""" + SELECT + aa.name as account_name, + aj.id, + aj.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY aa.name, aj.name, aj.id + """ + + cr = self._cr + cr.execute(query2, (data['date_from'], data['date_to'], account.id)) + fetch_data = cr.dictfetchall() + if fetched_data: + return { + 'account': account.name, + 'code': account.code, + 'move_lines': fetched_data, + 'journal_lines': fetch_data, + } + + def _get_journal_lines(self, account, data): + """ Fetch values based on journal and pass it in sublines""" + + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + query = f""" + SELECT + aa.name as account_name, + aj.id, + aj.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY aa.name, aj.name, aj.id + """ + cr = self._cr + cr.execute(query, (data['date_from'], data['date_to'], account.id)) + fetched_data = cr.dictfetchall() + if fetched_data: + return { + 'account': account.name, + 'journal_lines': fetched_data, + } diff --git a/advance_cash_flow_statements/wizard/report_account_wizard.py b/advance_cash_flow_statements/wizard/report_account_wizard.py new file mode 100644 index 000000000..0f1f6f614 --- /dev/null +++ b/advance_cash_flow_statements/wizard/report_account_wizard.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Abbas P (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, models + +class ReportAccountWizard(models.AbstractModel): + _name = "report.advance_cash_flow_statements.cash_flow_pdf_report" + _description = 'Report advanced cash flows' + + @api.model + def _get_report_values(self, docids, data=None): + fetched_data = [] + account_res = [] + journal_res = [] + fetched = [] + + active_model = self.env.context.get('active_model') + docs = self.env[active_model].browse(self.env.context.get('active_id')) + + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + if data['levels'] == 'summary': + query = f""" + SELECT + to_char(am.date, 'Month') as month_part, + EXTRACT(YEAR FROM am.date) as year_part, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY month_part, year_part + """ + self._cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = self._cr.dictfetchall() + + elif data['levels'] == 'consolidated': + query = f""" + SELECT + aa.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.name + """ + self._cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = self._cr.dictfetchall() + + elif data['levels'] == 'detailed': + query = f""" + SELECT + aa.name as name, + aa.code_store as code, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit, + SUM(aml.balance) AS total_balance + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.name, aa.code_store + """ + self._cr.execute(query, (data['date_from'], data['date_to'])) + fetched_data = self._cr.dictfetchall() + for account in self.env['account.account'].search([]): + child_lines = self._get_journal_lines(account, data) + if child_lines: + journal_res.append(child_lines) + + else: + query = f""" + SELECT + aa.name as name, + aa.code_store as code, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + GROUP BY aa.name, aa.code_store + """ + self._cr.execute(query, (data['date_from'], data['date_to'])) + fetched = self._cr.dictfetchall() + + for account in self.env['account.account'].search([]): + child_lines = self._get_lines(account, data) + if child_lines: + account_res.append(child_lines) + + # 🔽 FLATTEN DICTIONARIES HERE (before filtering and returning) + for entry in fetched_data: + if data['levels'] != 'summary': + entry['name'] = entry['name']['en_US'] if isinstance(entry['name'], dict) else entry['name'] + if data['levels'] not in ['summary', 'consolidated']: + entry['code'] = entry['code'].get('1') if isinstance(entry.get('code'), dict) else entry.get('code') + + for i in fetched: + i['name'] = i['name']['en_US'] if isinstance(i['name'], dict) else i['name'] + i['code'] = i['code'].get('1') if isinstance(i.get('code'), dict) else i.get('code') + + for res in journal_res: + res['account'] = res['account']['en_US'] if isinstance(res['account'], dict) else res['account'] + for jl in res.get('journal_lines', []): + jl['account_name'] = jl['account_name']['en_US'] if isinstance(jl['account_name'], dict) else jl[ + 'account_name'] + jl['name'] = jl['name']['en_US'] if isinstance(jl['name'], dict) else jl['name'] + + for res in account_res: + for ml in res.get('move_lines', []): + ml['name'] = ml['name']['en_US'] if isinstance(ml['name'], dict) else ml['name'] + for jl in res.get('journal_lines', []): + jl['account_name'] = jl['account_name']['en_US'] if isinstance(jl['account_name'], dict) else jl[ + 'account_name'] + jl['name'] = jl['name']['en_US'] if isinstance(jl['name'], dict) else jl['name'] + + # ✅ Filter out incomplete records + filtered_fetched_data = [entry for entry in fetched_data if None not in entry.values()] + + return { + 'date_from': data['date_from'], + 'date_to': data['date_to'], + 'levels': data['levels'], + 'doc_ids': self.ids, + 'doc_model': active_model, + 'docs': docs, + 'fetched_data': filtered_fetched_data, + 'account_res': account_res, + 'journal_res': journal_res, + 'fetched': fetched, + } + + def _get_lines(self, account, data): + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + query = f""" + SELECT + aml.account_id, + aj.name as name, + am.name as move_name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY am.name, aml.account_id, aj.name + """ + self._cr.execute(query, (data['date_from'], data['date_to'], account.id)) + fetched_data = self._cr.dictfetchall() + + query2 = f""" + SELECT + aa.name as account_name, + aj.id, + aj.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY aa.name, aj.name, aj.id + """ + self._cr.execute(query2, (data['date_from'], data['date_to'], account.id)) + fetch_data = self._cr.dictfetchall() + + if fetched_data: + return { + 'account': account.name, + 'code': account.code, + 'move_lines': fetched_data, + 'journal_lines': fetch_data, + } + + def _get_journal_lines(self, account, data): + state_clause = "AND am.state = 'posted'" if data['target_move'] == 'posted' else '' + + query = f""" + SELECT + aa.name as account_name, + aj.id, + aj.name as name, + SUM(aml.debit) AS total_debit, + SUM(aml.credit) AS total_credit + FROM account_move_line aml + JOIN account_move am ON aml.move_id = am.id + JOIN account_account aa ON aa.id = aml.account_id + JOIN account_journal aj ON aj.id = am.journal_id + WHERE am.date BETWEEN %s AND %s + {state_clause} + AND aa.id = %s + GROUP BY aa.name, aj.name, aj.id + """ + self._cr.execute(query, (data['date_from'], data['date_to'], account.id)) + fetched_data = self._cr.dictfetchall() + + if fetched_data: + return { + 'account': account.name, + 'journal_lines': fetched_data, + } +