Browse Source

[ADD] Initial commit 'dynamic_accounts_report'

pull/195/head
Ajmal Cybro 4 years ago
parent
commit
6ad6ea7296
  1. 44
      dynamic_accounts_report/README.rst
  2. 26
      dynamic_accounts_report/__init__.py
  3. 81
      dynamic_accounts_report/__manifest__.py
  4. 3
      dynamic_accounts_report/controllers/__init__.py
  5. 37
      dynamic_accounts_report/controllers/controllers.py
  6. 9
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  7. 7
      dynamic_accounts_report/report/__init__.py
  8. 19
      dynamic_accounts_report/report/ageing.py
  9. 168
      dynamic_accounts_report/report/ageing.xml
  10. 16
      dynamic_accounts_report/report/cash_flow_report.py
  11. 263
      dynamic_accounts_report/report/cash_flow_report.xml
  12. 17
      dynamic_accounts_report/report/daybook.py
  13. 121
      dynamic_accounts_report/report/daybook.xml
  14. 165
      dynamic_accounts_report/report/financial_report_template.xml
  15. 20
      dynamic_accounts_report/report/financial_reports.py
  16. 20
      dynamic_accounts_report/report/general_ledger.py
  17. 153
      dynamic_accounts_report/report/general_ledger.xml
  18. 16
      dynamic_accounts_report/report/partner_ledger.py
  19. 155
      dynamic_accounts_report/report/partner_ledger.xml
  20. 18
      dynamic_accounts_report/report/trial_balance.py
  21. 129
      dynamic_accounts_report/report/trial_balance.xml
  22. 8
      dynamic_accounts_report/security/ir.model.access.csv
  23. BIN
      dynamic_accounts_report/static/description/assets/icons/check.png
  24. BIN
      dynamic_accounts_report/static/description/assets/icons/chevron.png
  25. BIN
      dynamic_accounts_report/static/description/assets/icons/cogs.png
  26. BIN
      dynamic_accounts_report/static/description/assets/icons/consultation.png
  27. BIN
      dynamic_accounts_report/static/description/assets/icons/ecom-black.png
  28. BIN
      dynamic_accounts_report/static/description/assets/icons/education-black.png
  29. BIN
      dynamic_accounts_report/static/description/assets/icons/hotel-black.png
  30. BIN
      dynamic_accounts_report/static/description/assets/icons/license.png
  31. BIN
      dynamic_accounts_report/static/description/assets/icons/lifebuoy.png
  32. BIN
      dynamic_accounts_report/static/description/assets/icons/logo.png
  33. BIN
      dynamic_accounts_report/static/description/assets/icons/manufacturing-black.png
  34. BIN
      dynamic_accounts_report/static/description/assets/icons/pos-black.png
  35. BIN
      dynamic_accounts_report/static/description/assets/icons/puzzle.png
  36. BIN
      dynamic_accounts_report/static/description/assets/icons/restaurant-black.png
  37. BIN
      dynamic_accounts_report/static/description/assets/icons/service-black.png
  38. BIN
      dynamic_accounts_report/static/description/assets/icons/trading-black.png
  39. BIN
      dynamic_accounts_report/static/description/assets/icons/training.png
  40. BIN
      dynamic_accounts_report/static/description/assets/icons/update.png
  41. BIN
      dynamic_accounts_report/static/description/assets/icons/user.png
  42. BIN
      dynamic_accounts_report/static/description/assets/icons/wrench.png
  43. BIN
      dynamic_accounts_report/static/description/assets/modules/approval_image.png
  44. BIN
      dynamic_accounts_report/static/description/assets/modules/budget_image.png
  45. BIN
      dynamic_accounts_report/static/description/assets/modules/export_image.png
  46. BIN
      dynamic_accounts_report/static/description/assets/modules/magento_image.png
  47. BIN
      dynamic_accounts_report/static/description/assets/modules/pos_image.png
  48. BIN
      dynamic_accounts_report/static/description/assets/modules/shopify_image.png
  49. BIN
      dynamic_accounts_report/static/description/assets/screenshots/01_balance-sheet-report-1.png
  50. BIN
      dynamic_accounts_report/static/description/assets/screenshots/02_balance-sheet-report -2-PDF.png
  51. BIN
      dynamic_accounts_report/static/description/assets/screenshots/03_balance-sheet-report-3-xlsx.png
  52. BIN
      dynamic_accounts_report/static/description/assets/screenshots/04_balance-sheet-report-4-View-General-Ledger.png
  53. BIN
      dynamic_accounts_report/static/description/assets/screenshots/05_balance-sheet report -5-View-source -move.png
  54. BIN
      dynamic_accounts_report/static/description/assets/screenshots/06_bankbook-drill-down-1.png
  55. BIN
      dynamic_accounts_report/static/description/assets/screenshots/07_bank-book-pdf -2.png
  56. BIN
      dynamic_accounts_report/static/description/assets/screenshots/08_bank-book-xlsx-3.png
  57. BIN
      dynamic_accounts_report/static/description/assets/screenshots/09_filter-applied-in-bank-book.png
  58. BIN
      dynamic_accounts_report/static/description/assets/screenshots/10_cash-book-drill-down.png
  59. BIN
      dynamic_accounts_report/static/description/assets/screenshots/11_journal-entry-from-cash-book.png
  60. BIN
      dynamic_accounts_report/static/description/assets/screenshots/12_cash-flow-statement-detailed-view.png
  61. BIN
      dynamic_accounts_report/static/description/assets/screenshots/13_detailed-pdf-report.png
  62. BIN
      dynamic_accounts_report/static/description/assets/screenshots/14_detailed-xlsx-report.png
  63. BIN
      dynamic_accounts_report/static/description/assets/screenshots/15_various-report-levels-in-cash-flow.png
  64. BIN
      dynamic_accounts_report/static/description/assets/screenshots/16_daybook-drilldown.png
  65. BIN
      dynamic_accounts_report/static/description/assets/screenshots/17_journal-entry-from-daybook.png
  66. BIN
      dynamic_accounts_report/static/description/assets/screenshots/18_general_ledger_drilldown.png
  67. BIN
      dynamic_accounts_report/static/description/assets/screenshots/19_general_ledger_report.png
  68. BIN
      dynamic_accounts_report/static/description/assets/screenshots/20_partner-ageing-drill-down.png
  69. BIN
      dynamic_accounts_report/static/description/assets/screenshots/21_partner-ageing-with-filters-and-report-printing-option.png
  70. BIN
      dynamic_accounts_report/static/description/assets/screenshots/22_partner-ledger-drill-down.png
  71. BIN
      dynamic_accounts_report/static/description/assets/screenshots/23_partner-ledger-with-filters-and-report-printing-option.png
  72. BIN
      dynamic_accounts_report/static/description/assets/screenshots/24_profit-and-loss-report-with-filters-and-report-printing-option.png
  73. BIN
      dynamic_accounts_report/static/description/assets/screenshots/25_journal-entry-view-from-general-ledger-wizard.png
  74. BIN
      dynamic_accounts_report/static/description/assets/screenshots/26_general-ledger-wizard-with-drill-down-in-profit-and-loss.png
  75. BIN
      dynamic_accounts_report/static/description/assets/screenshots/27_view-source-move-from-general-ledger-wizard-in-profit-and-loss.png
  76. BIN
      dynamic_accounts_report/static/description/assets/screenshots/28_trial-balance-report-with-filters-and-report-viewing-option.png
  77. BIN
      dynamic_accounts_report/static/description/assets/screenshots/29-general-ledger-wizard-with-drill-down- and-view-source-move-option.png
  78. BIN
      dynamic_accounts_report/static/description/assets/screenshots/30_Dynamic-Reports-Menu.png
  79. BIN
      dynamic_accounts_report/static/description/assets/screenshots/31_Financial-Report-Configuration-1.png
  80. BIN
      dynamic_accounts_report/static/description/assets/screenshots/32_Financial-Report-Configuration-2.png
  81. BIN
      dynamic_accounts_report/static/description/assets/screenshots/ageing filters applied.png
  82. BIN
      dynamic_accounts_report/static/description/assets/screenshots/ageing pdf report.png
  83. BIN
      dynamic_accounts_report/static/description/assets/screenshots/ageing source move.png
  84. BIN
      dynamic_accounts_report/static/description/assets/screenshots/ageing xlsx report.png
  85. BIN
      dynamic_accounts_report/static/description/assets/screenshots/balance sheet pdf report.png
  86. BIN
      dynamic_accounts_report/static/description/assets/screenshots/balance sheet report.png
  87. BIN
      dynamic_accounts_report/static/description/assets/screenshots/balance sheet xlsx report.png
  88. BIN
      dynamic_accounts_report/static/description/assets/screenshots/bank book journal entry.png
  89. BIN
      dynamic_accounts_report/static/description/assets/screenshots/bank book pdf.png
  90. BIN
      dynamic_accounts_report/static/description/assets/screenshots/bank book report with filters and report viewing option.png
  91. BIN
      dynamic_accounts_report/static/description/assets/screenshots/bank book xlsx.png
  92. BIN
      dynamic_accounts_report/static/description/assets/screenshots/bankbook drill down.png
  93. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash book drill down.png
  94. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash book pdf.png
  95. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash book xlsx.png
  96. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash flow statement detailed view.png
  97. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash flow statement summary.png
  98. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash flow statement with filters and report printing option.png
  99. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cash flow very deatiled xlsx.png
  100. BIN
      dynamic_accounts_report/static/description/assets/screenshots/cashbook report with filters and report printing option.png

44
dynamic_accounts_report/README.rst

@ -0,0 +1,44 @@
Dynamic Financial Reports
=========================
* Dynamic financial reports for Odoo 15 community editions
Installation
============
- www.odoo.com/documentation/15.0/setup/install.html
- Install our custom addon
License
-------
General Public License, Version 3 (LGPL v3).
(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html)
Company
-------
* 'Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer:
(v15) Jibin @ Cybrosys
(v15) Mehjabin @ Cybrosys
(v15) Mily @ Cybrosys
(v15) Aneesh @ Cybrosys
Contacts
--------
* Mail Contact : odoo@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
==========
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com
Further information
===================
HTML Description: `<static/description/index.html>`__

26
dynamic_accounts_report/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import controllers
from . import wizard
from . import report

81
dynamic_accounts_report/__manifest__.py

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.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 <http://www.gnu.org/licenses/>.
#
#############################################################################
{
'name': 'Dynamic Financial Reports',
'version': '15.0.1.0.0',
'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=gVQi9q9Rs-E&t=5s',
'summary': """Dynamic Financial Reports with drill
down and filters Community Edition""",
'description': "Dynamic Financial Reports, DynamicFinancialReports, FinancialReport, Accountingreports, odoo reports, odoo"
"This module creates dynamic Accounting General Ledger, Trial Balance, Balance Sheet "
"Proft and Loss, Cash Flow Statements, Partner Ledger,"
"Partner Ageing, Day book"
"Bank book and Cash book reports in Odoo 14 community edition.",
'author': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'depends': ['base', 'base_accounting_kit'],
'data': [
'security/ir.model.access.csv',
'views/templates.xml',
'views/views.xml',
'views/kit_menus.xml',
'report/trial_balance.xml',
'report/general_ledger.xml',
'report/cash_flow_report.xml',
'report/financial_report_template.xml',
'report/partner_ledger.xml',
'report/ageing.xml',
'report/daybook.xml',
],
'assets': {
'web.assets_backend': [
'dynamic_accounts_report/static/src/css/report.css',
'dynamic_accounts_report/static/src/js/action_manager.js',
'dynamic_accounts_report/static/src/js/general_ledger.js',
'dynamic_accounts_report/static/src/js/trial_balance.js',
'dynamic_accounts_report/static/src/js/cash_flow.js',
'dynamic_accounts_report/static/src/js/financial_reports.js',
'dynamic_accounts_report/static/src/js/partner_ledger.js',
'dynamic_accounts_report/static/src/js/ageing.js',
'dynamic_accounts_report/static/src/js/daybook.js',
],
'web.assets_qweb': [
'dynamic_accounts_report/static/src/xml/general_ledger_view.xml',
'dynamic_accounts_report/static/src/xml/trial_balance_view.xml',
'dynamic_accounts_report/static/src/xml/cash_flow_view.xml',
'dynamic_accounts_report/static/src/xml/financial_reports_view.xml',
'dynamic_accounts_report/static/src/xml/partner_ledger_view.xml',
'dynamic_accounts_report/static/src/xml/ageing.xml',
'dynamic_accounts_report/static/src/xml/daybook.xml',
],
},
'license': 'LGPL-3',
'images': ['static/description/banner.png'],
'installable': True,
'auto_install': False,
'application': False,
}

3
dynamic_accounts_report/controllers/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import controllers

37
dynamic_accounts_report/controllers/controllers.py

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
import json
from odoo import http
from odoo.http import content_disposition, request
from odoo.addons.web.controllers.main import _serialize_exception
from odoo.tools import html_escape
class TBXLSXReportController(http.Controller):
@http.route('/dynamic_xlsx_reports', type='http', auth='user', methods=['POST'], csrf=False)
def get_report_xlsx(self, model, options, output_format, report_data, report_name, dfr_data, **kw):
uid = request.session.uid
report_obj = request.env[model].with_user(uid)
dfr_data = dfr_data
options = 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_dynamic_xlsx_report(options, response, report_data, dfr_data)
response.set_cookie('fileToken', token)
return response
except Exception as e:
se = _serialize_exception(e)
error = {
'code': 200,
'message': 'Odoo Server Error',
'data': se
}
return request.make_response(html_escape(json.dumps(error)))

9
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -0,0 +1,9 @@
## Module <dynamic_accounts_report>
#### 02.09.2021
#### Version 15.0.1.0.0
#### ADD
- Initial commit for Odoo 15 dynamic financial reports

7
dynamic_accounts_report/report/__init__.py

@ -0,0 +1,7 @@
from . import trial_balance
from . import general_ledger
from . import cash_flow_report
from . import financial_reports
from . import partner_ledger
from . import ageing
from . import daybook

19
dynamic_accounts_report/report/ageing.py

@ -0,0 +1,19 @@
from odoo import api, models, _
class PartnerAgeing(models.AbstractModel):
_name = 'report.dynamic_accounts_report.partner_ageing'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('ageing_pdf_report'):
if data.get('report_data'):
data.update(
{'account_data': data.get('report_data')['report_lines'][0],
'Filters': data.get('report_data')['filters'],
'company': self.env.company,
})
return data

168
dynamic_accounts_report/report/ageing.xml

@ -0,0 +1,168 @@
<odoo>
<template id="dynamic_accounts_report.partner_ageing">
<t t-call="web.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout">
<div class="page">
<div class="oe_structure"/>
<h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Partner Ageing
</h3>
<strong> As On Date:</strong>
<t t-esc="Filters['date_from']"/>
<div>
<div style="text-align:centre;left:50%;" class="row">
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
<div class="col-3">
<strong>Account Type:</strong>
<li>
<t t-esc="Filters['result_selection']"/>
</li>
</div>
<div class="col-3" style="">
<strong>Partners :</strong>
<t t-foreach="Filters['partners']" t-as="pa">
<li>
<t t-esc="pa"/>
</li>
</t>
</div>
<div class="col-3" style="">
<strong>Partner Tag :</strong>
<t t-foreach="Filters['partner_tags']" t-as="pt">
<li>
<t t-esc="pt"/>
</li>
</t>
</div>
</div>
<br></br>
<table class="table table-sm table-reports">
<thead>
<tr class="text-center">
<th>Entry Label</th>
<th>Due date</th>
<th>JRNL</th>
<th>Account</th>
<th>Not Due</th>
<th>0 - 30</th>
<th>30 - 60</th>
<th>60 - 90</th>
<th>90 - 120</th>
<th>120 +</th>
<th> Total</th>
<th groups="base.group_multi_currency">Currency</th>
</tr>
</thead>
<tbody>
<t t-foreach="account_data" t-as="account">
<tr style="font-weight: bold;">
<td colspan="4">
<span style="color: white;" t-esc="'..'"/>
<span t-esc="account['name']"/>
</td>
<td class="text-right">
<span t-esc="account['direction']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['4']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['3']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['2']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['1']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['0']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['total']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td groups="base.group_multi_currency"/>
</tr>
<tr t-foreach="account['child_lines']" t-as="line">
<td><span t-esc="line['move']"/></td>
<td><span t-esc="line['date']"/></td>
<td><span t-esc="line['jrnl']"/></td>
<td><span t-esc="line['acc_code']"/></td>
<td class="text-right">
<span t-if="line.get('period6')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
<td class="text-right">
<span t-if="line.get('period5')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
<td class="text-right">
<span t-if="line.get('period4')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
<td class="text-right">
<span t-if="line.get('period3')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
<td class="text-right">
<span t-if="line.get('period2')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
<td class="text-right">
<span t-if="line.get('period1')"
t-esc="line['amount']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
<span t-else="">
<span>-</span>
</span>
</td>
</tr>
</t>
</tbody>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_ageing_partner" model="ir.actions.report">
<field name="name">Partner Ageing</field>
<field name="model">account.partner.ageing</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.partner_ageing</field>
<field name="report_file">dynamic_accounts_report.partner_ageing</field>
</record>
</odoo>

16
dynamic_accounts_report/report/cash_flow_report.py

@ -0,0 +1,16 @@
from odoo import api, models, _
class GeneralLedger(models.AbstractModel):
_name = 'report.dynamic_accounts_report.cash_flow'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('trial_pdf_report'):
if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'],
'company': self.env.company,
})
return data

263
dynamic_accounts_report/report/cash_flow_report.xml

@ -0,0 +1,263 @@
<odoo>
<template id="dynamic_accounts_report.cash_flow">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div style="font-size:12px" class="col-4">
<b>Report Date :</b>
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
<span t-esc='today'/>
<br/>
<span t-esc='logged_users'/>
</div>
<div class="page">
<h4 style="padding-left:10px !important">Cash Flow statements</h4>
<div style="width:90%;margin:1px auto;font-size:12px" class="row mt32 mb32">
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
<div class="col-3">
<t t-if="Filters.get('levels')">
<strong>Level :</strong>
<li>
<t t-esc="Filters['levels']"/>
</li>
</t>
</div>
<div class="col-4">
<p>
<t t-if="Filters.get('date_from')">
<strong>Date from :</strong>
<span t-esc="Filters.get('date_from')"/>
</t>
<br/>
<t t-if="Filters.get('date_to')">
<strong>Date to :</strong>
<span t-esc="Filters.get('date_to')"/>
</t>
</p>
</div>
</div>
<div>
<br></br>
<table style="width:90%;margin:2px auto;" class="table table-condensed">
<thead>
<tr style="font-size:13px; padding: 0.25rem !important;">
<th>Name</th>
<th class="text-right">Cash In</th>
<th class="text-right">Cash Out</th>
<th class="text-right">Balance</th>
</tr>
</thead>
<tbody style="font-size:12px" t-foreach="account_data['fetched_data']" t-as="fetch">
<tr t-if="Filters['levels' ] == 'summary'">
<td>
<span t-esc="fetch['month_part']"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_balance']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
</tr>
<tr style="font-size:13px" t-if="Filters['levels' ] == 'consolidated'">
<td>
<span t-esc="fetch['name']"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="fetch['total_balance']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
</tr>
</tbody>
<tbody style="font-size:12px" t-if="Filters['levels' ] == 'detailed' " t-foreach="account_data['journal_res']" t-as="res">
<tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet">
<td>
<strong>
<span t-esc="fet['code']"/>
<span t-esc="fet['name']"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_debit'] - fet['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<tr t-foreach="res['journal_lines']" t-as="mov">
<td style="padding-left:50px !important" class="text-left">
<span t-esc="mov['name']"/>
</td>
<td class="text-right">
<span t-esc="mov['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="mov['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="mov['total_debit'] - mov['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
</tr>
</tr>
</tbody>
<tbody style="font-size:12px" t-if="Filters['levels' ] == 'very' or Filters['levels' ] ==false " t-foreach="account_data['account_res']" t-as="res">
<tr t-if="fet['name'] == res['account']" t-foreach="account_data['fetched_data']" t-as="fet">
<td>
<strong>
<span t-esc="fet['code']"/>
<span t-esc="fet['name']"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<td class="text-right">
<strong>
<span t-esc="fet['total_debit'] - fet['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</strong>
</td>
<tr t-if="line['account_name'] == res['account']"
t-foreach="res['journal_lines']" t-as="line">
<td style="padding-left:20px !important" class="text-left">
<span t-esc="line['name']"/>
</td>
<td class="text-right">
<span t-esc="line['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['total_debit'] - line['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<tr t-if="mov['name'] == line['name']" t-foreach="res['move_lines']"
t-as="mov">
<td style="padding-left:50px !important" class="text-left">
<span t-esc="mov['move_name']"/>
</td>
<td class="text-right">
<span t-esc="mov['total_debit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="mov['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="mov['total_debit'] - mov['total_credit']"
t-options="{'widget': 'monetary',
'display_currency': res_company.currency_id}"/>
</td>
</tr>
</tr>
</tr>
</tbody>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_cash_flow" model="ir.actions.report">
<field name="name">cash_flow</field>
<field name="model">account.cash.flow</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.cash_flow</field>
<field name="report_file">dynamic_accounts_report.cash_flow</field>
</record>
</odoo>

17
dynamic_accounts_report/report/daybook.py

@ -0,0 +1,17 @@
from odoo import api, models, _
class DayBook(models.AbstractModel):
_name = 'report.dynamic_accounts_report.day_book'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('daybook_pdf_report'):
if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'],
'company': self.env.company,
})
return data

121
dynamic_accounts_report/report/daybook.xml

@ -0,0 +1,121 @@
<odoo>
<template id="dynamic_accounts_report.day_book">
<t t-call="web.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout">
<div class="page">
<div class="oe_structure"/>
<h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Day Book
</h3>
<span t-if="Filters.get('date_from')">
<strong> From:</strong>
<t t-esc="Filters['date_from']"/>
</span>
<br></br>
<span t-if="Filters.get('date_to')">
<strong> To:</strong>
<t t-esc="Filters['date_to']"/>
</span>
<div>
<div style="text-align:centre;left:50%;" class="row">
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
<div class="col-3" style="">
<strong>Journals:</strong>
<t t-foreach="Filters['journals']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-3" style="">
<strong>Accounts :</strong>
<t t-foreach="Filters['accounts']" t-as="ac">
<li>
<t t-esc="ac"/>
</li>
</t>
</div>
</div>
<br></br>
<table class="table table-sm table-reports">
<thead>
<tr class="text-center">
<th>Date</th>
<th>JRNL</th>
<th>Partner</th>
<th>Move</th>
<th>Entry Label</th>
<th>Debit</th>
<th>Credit</th>
<th>Balance</th>
<th groups="base.group_multi_currency">Currency</th>
</tr>
</thead>
<tbody>
<t t-foreach="account_data" t-as="account">
<tr style="font-weight: bold;">
<td colspan="5">
<span style="color: white;" t-esc="'..'"/>
<span t-esc="account['date']"/>
</td>
<td class="text-right">
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td groups="base.group_multi_currency"/>
</tr>
<tr t-foreach="account['child_lines']" t-as="line">
<td><span t-esc="line['ldate']"/></td>
<td><span t-esc="line['lcode']"/></td>
<td><span t-esc="line['partner_name']"/></td>
<td><span t-esc="line['move_name']"/></td>
<td><span t-esc="line['lname']"/></td>
<td class="text-right">
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_day_book" model="ir.actions.report">
<field name="name">Day Book</field>
<field name="model">account.day.book</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.day_book</field>
<field name="report_file">dynamic_accounts_report.day_book</field>
</record>
</odoo>

165
dynamic_accounts_report/report/financial_report_template.xml

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="dynamic_accounts_report.balance_sheet">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<div class="page">
<h3><span t-esc="Filters.get('company_name')"/>: <span t-esc="report_name"/>
</h3>
<div>
<span t-if="Filters.get('date_from')">
<strong> From:</strong>
<t t-esc="Filters['date_from']"/>
</span>
<span t-if="Filters.get('date_to')">
<strong>To:</strong>
<t t-esc="Filters['date_to']"/>
</span>
<div style="width:100%;">
<div style="text-align:centre;" class="row">
<div class="col-2">
<strong>Journals:</strong>
<t t-foreach="Filters['journals']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Accounts:</strong>
<t t-foreach="Filters['accounts']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Account Tags:</strong>
<t t-foreach="Filters['account_tags']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Analytic:</strong>
<t t-foreach="Filters['analytics']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Analytic Tag:</strong>
<t t-foreach="Filters['analytic_tags']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
</div>
</div>
</div>
<br></br>
<table class="table table-sm table-reports">
<thead>
<tr>
<th></th>
<th class="text-right">Debit</th>
<th class="text-right">Credit</th>
<th class="text-right">Balance</th>
</tr>
</thead>
<tbody>
<tr t-foreach="report_lines" t-as="a">
<t t-if="a['level'] != 0">
<t t-if="a.get('level') &gt; 2">
<t t-set="style" t-value="'font-weight: normal;'"/>
</t>
<t t-if="not a.get('level') &gt; 2">
<t t-set="style" t-value="'font-weight: bold;'"/>
</t>
<t t-if="a.get('code')">
<t t-foreach="account_data" t-as="line">
<t t-if="line['code'] == a.get('code')">
<tr>
<td>
<span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/>
<span t-att-style="style" t-esc="line['name']"/>
</td>
<td class="text-right">
<span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['balance']"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
</tr>
</t>
</t>
</t>
<t t-else="">
<td>
<span style="color: white;" t-esc="'..' * a.get('level', 0) * 3"/>
<span t-att-style="style" t-esc="a.get('name')"/>
</td>
<td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('debit')"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('credit')"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('balance')"
t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
</t>
</t>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</template>
<record id="action_print_balance_sheet" model="ir.actions.report">
<field name="name">Financial Report</field>
<field name="model">dynamic.balance.sheet.report</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.balance_sheet</field>
<field name="report_file">dynamic_accounts_report.balance_sheet</field>
</record>
</odoo>

20
dynamic_accounts_report/report/financial_reports.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from odoo import api, models, _
class InsReportBalanceSheet(models.AbstractModel):
_name = 'report.dynamic_accounts_report.balance_sheet'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('bs_report'):
if data.get('report_data'):
data.update({
'Filters': data.get('report_data')['filters'],
'account_data': data.get('report_data')['report_lines'],
'report_lines': data.get('report_data')['bs_lines'],
'report_name': data.get('report_name'),
'title': data.get('report_data')['name'],
'company': self.env.company,
})
return data

20
dynamic_accounts_report/report/general_ledger.py

@ -0,0 +1,20 @@
from odoo import api, models, _
class GeneralLedger(models.AbstractModel):
_name = 'report.dynamic_accounts_report.general_ledger'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('trial_pdf_report'):
if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'],
'debit_total': data.get('report_data')['debit_total'],
'credit_total': data.get('report_data')['credit_total'],
'title': data.get('report_data')['name'],
'company': self.env.company,
})
return data

153
dynamic_accounts_report/report/general_ledger.xml

@ -0,0 +1,153 @@
<odoo>
<template id="dynamic_accounts_report.general_ledger">
<t t-call="web.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout">
<div class="page">
<div class="oe_structure"/>
<h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: <t t-esc="title"/>
</h3>
<span t-if="Filters.get('date_from')">
<strong> From:</strong>
<t t-esc="Filters['date_from']"/>
</span>
<span t-if="Filters.get('date_to')">
<strong>To:</strong>
<t t-esc="Filters['date_to']"/>
</span>
<div>
<div style="width:100%;">
<div style="text-align:centre;" class="row">
<div class="col-2">
<strong>Journals:</strong>
<t t-foreach="Filters['journals']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Accounts:</strong>
<t t-foreach="Filters['accounts']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Analytic:</strong>
<t t-foreach="Filters['analytics']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Analytic Tag:</strong>
<t t-foreach="Filters['analytic_tags']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
</div>
</div>
<br></br>
<table class="table table-sm table-reports">
<thead>
<tr class="text-right">
<th>Date</th>
<th>JRNL</th>
<th>Partner</th>
<th>Ref</th>
<th>Move</th>
<th>Entry Label</th>
<th>Debit</th>
<th>Credit</th>
<th>Balance</th>
<th groups="base.group_multi_currency">Currency</th>
</tr>
</thead>
<tbody>
<t t-foreach="account_data" t-as="account">
<tr style="font-weight: bold;">
<td colspan="6">
<span style="color: white;" t-esc="'..'"/>
<span t-esc="account['code']"/>
<span t-esc="account['name']"/>
</td>
<td class="text-right">
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td groups="base.group_multi_currency"/>
</tr>
<tr t-foreach="account['move_lines']" t-as="line">
<td><span t-esc="line['ldate']"/></td>
<td><span t-esc="line['lcode']"/></td>
<td><span t-esc="line['partner_name']"/></td>
<td><span t-if="line['lref']" t-esc="line['lref']"/></td>
<td><span t-esc="line['move_name']"/></td>
<td><span t-esc="line['lname']"/></td>
<td class="text-right">
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<t t-if="line['amount_currency']">
<td class="text-right" groups="base.group_multi_currency">
<span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/>
<span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/>
</td>
</t>
</tr>
</t>
</tbody>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_General_ledger" model="ir.actions.report">
<field name="name">Report</field>
<field name="model">account.general.ledger</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.general_ledger</field>
<field name="report_file">dynamic_accounts_report.general_ledger</field>
</record>
</odoo>

16
dynamic_accounts_report/report/partner_ledger.py

@ -0,0 +1,16 @@
from odoo import api, models, _
class PartnerLedgerReport(models.AbstractModel):
_name = 'report.dynamic_accounts_report.partner_ledger'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('partner_ledger_pdf_report'):
if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'],
'company': self.env.company,
})
return data

155
dynamic_accounts_report/report/partner_ledger.xml

@ -0,0 +1,155 @@
<odoo>
<template id="dynamic_accounts_report.partner_ledger">
<t t-call="web.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout">
<div class="page">
<div class="oe_structure"/>
<h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Partner Ledger
</h3>
<span t-if="Filters.get('date_from')">
<strong> From:</strong>
<t t-esc="Filters['date_from']"/>
</span>
<span t-if="Filters.get('date_to')">
<strong>To:</strong>
<t t-esc="Filters['date_to']"/>
</span>
<div>
<div style="text-align:centre;left:50%;" class="row">
<div class="col-2" style="">
<strong>Journals:</strong>
<t t-foreach="Filters['journals']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Accounts:</strong>
<t t-foreach="Filters['accounts']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Partners:</strong>
<t t-foreach="Filters['partners']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Partner Tags:</strong>
<t t-foreach="Filters['partner_tags']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Account Type:</strong>
<t t-foreach="Filters['account_type']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-2">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
</div>
<div style="text-align:centre;left:50%;" class="row">
</div>
<br></br>
<table class="table table-sm table-reports" style="padding:5px;">
<thead>
<tr class="text-center">
<th style="text-align:left;">Date</th>
<th style="text-align:left;">Journal</th>
<th style="text-align:left;">Account</th>
<th style="text-align:left;">Move</th>
<th style="text-align:left;">Entry Label</th>
<th style="text-align:right;">Debit</th>
<th style="text-align:right;">Credit</th>
<th style="text-align:right;">Balance</th>
</tr>
</thead>
<tbody>
<t t-foreach="account_data" t-as="account">
<tr style="font-weight: bold;">
<td colspan="5">
<span style="color: white;" t-esc="'..'"/>
<!-- <span t-esc="account['code']"/>-->
<span t-esc="account['name']"/>
</td>
<td class="text-right">
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td groups="base.group_multi_currency"/>
</tr>
<tr t-foreach="account['move_lines']" t-as="line">
<td><span t-esc="line['ldate']"/></td>
<td><span t-esc="line['lcode']"/></td>
<td><span t-esc="line['account_name']"/></td>
<!-- <td><span t-if="line['lref']" t-esc="line['lref']"/></td>-->
<td><span t-esc="line['move_name']"/></td>
<td><span t-esc="line['lname']"/></td>
<td class="text-right">
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td>
<t t-if="line['amount_currency']">
<td class="text-right" groups="base.group_multi_currency">
<span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/>
<span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/>
</td>
</t>
</tr>
</t>
</tbody>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_partner_ledger" model="ir.actions.report">
<field name="name">Partner ledger</field>
<field name="model">account.partner.ledger</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.partner_ledger</field>
<field name="report_file">dynamic_accounts_report.partner_ledger</field>
</record>
</odoo>

18
dynamic_accounts_report/report/trial_balance.py

@ -0,0 +1,18 @@
from odoo import api, models, _
class TrialBalance(models.AbstractModel):
_name = 'report.dynamic_accounts_report.trial_balance'
@api.model
def _get_report_values(self, docids, data=None):
if self.env.context.get('trial_pdf_report'):
if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'],
'debit_total': data.get('report_data')['debit_total'],
'credit_total': data.get('report_data')['credit_total'],
'company': self.env.company,
})
return data

129
dynamic_accounts_report/report/trial_balance.xml

@ -0,0 +1,129 @@
<odoo>
<template id="dynamic_accounts_report.trial_balance">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page">
<div class="oe_structure"/>
<h3 style="text-align:centre;left:50%;"><span t-esc="Filters.get('company_name')"/>: Trial Balance
</h3>
<span t-if="Filters.get('date_from')">
<strong> From:</strong>
<t t-esc="Filters['date_from']"/>
</span>
<span t-if="Filters.get('date_to')">
<strong>To:</strong>
<t t-esc="Filters['date_to']"/>
</span>
<div>
<div style="text-align:centre;left:50%;" class="row">
<div class="col-3" style="">
<strong>Journals:</strong>
<t t-foreach="Filters['journals']" t-as="ps">
<li>
<t t-esc="ps"/>
</li>
</t>
</div>
<div class="col-3">
<strong>Target move:</strong>
<li>
<t t-esc="Filters['target_move']"/>
</li>
</div>
</div>
<br></br>
<table class="table table-sm table-reports">
<thead>
<tr>
<th style="text-align:left;">Code</th>
<th colspan="5">Account</th>
<t t-if="Filters.get('date_from')">
<th class="mon_fld">Initial Debit</th>
<th class="mon_fld">Initial Credit</th>
</t>
<th class="text-right">Debit</th>
<th class="text-right">Credit</th>
</tr>
</thead>
<t t-foreach="account_data" t-as="line">
<tr>
<td style="text-align:left;">
<span style="color: white;" t-esc="'..'"/>
<span t-esc="line['code']"/>
</td>
<td colspan="5">
<span style="color: white;" t-esc="'..'"/>
<span t-esc="line['name']"/>
</td>
<t t-if="Filters.get('date_from')">
<t t-if="line['Init_balance']">
<td class="mon_fld">
<t t-out="line['Init_balance']['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="mon_fld">
<t t-out="line['Init_balance']['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
<t t-else="">
<td class="mon_fld">
</td>
<td class="mon_fld">
</td>
</t>
</t>
<td class="text-right">
<span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-right">
<span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
</t>
<td colspan="6" style="border-bottom: 1px solid ;" class="mon_fld"><strong>Total</strong></td>
<t t-if="Filters.get('date_from')">
<td class="mon_fld" style="border-bottom: 1px solid ;"><strong></strong></td>
<td class="mon_fld" style="border-bottom: 1px solid ;"><strong></strong></td>
</t>
<td class="text-right" style="border-bottom: 1px solid ;"><strong><t t-esc="debit_total" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></strong></td>
<td class="text-right" style="border-bottom: 1px solid;"><strong><t t-esc="debit_total" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></strong></td>
</table>
</div>
<br></br>
</div>
</t>
</t>
</template>
<record id="action_print_trial_balance" model="ir.actions.report">
<field name="name">Trial Balance</field>
<field name="model">account.trial.balance</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dynamic_accounts_report.trial_balance</field>
<field name="report_file">dynamic_accounts_report.trial_balance</field>
</record>
</odoo>

8
dynamic_accounts_report/security/ir.model.access.csv

@ -0,0 +1,8 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_general_ledger,access.account.general.ledger,model_account_general_ledger,account.group_account_user,1,1,1,1
access_account_trial_balance,access.account.trial.balance,model_account_trial_balance,account.group_account_user,1,1,1,1
access_account_cash_flow,access.account.cash.flow,model_account_cash_flow,account.group_account_user,1,1,1,1
access_dynamic_balance_sheet_report,access.dynamic.balance.sheet.report,model_dynamic_balance_sheet_report,account.group_account_user,1,1,1,1
access_account_partner_ledger,access.account.partner.ledger,model_account_partner_ledger,account.group_account_user,1,1,1,1
access_account_partner_ageing,account_partner_ageing.account_partner_ageing,model_account_partner_ageing,account.group_account_user,1,1,1,1
access_account_day_book,account_day_book.account_day_book,model_account_day_book,account.group_account_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_general_ledger access.account.general.ledger model_account_general_ledger account.group_account_user 1 1 1 1
3 access_account_trial_balance access.account.trial.balance model_account_trial_balance account.group_account_user 1 1 1 1
4 access_account_cash_flow access.account.cash.flow model_account_cash_flow account.group_account_user 1 1 1 1
5 access_dynamic_balance_sheet_report access.dynamic.balance.sheet.report model_dynamic_balance_sheet_report account.group_account_user 1 1 1 1
6 access_account_partner_ledger access.account.partner.ledger model_account_partner_ledger account.group_account_user 1 1 1 1
7 access_account_partner_ageing account_partner_ageing.account_partner_ageing model_account_partner_ageing account.group_account_user 1 1 1 1
8 access_account_day_book account_day_book.account_day_book model_account_day_book account.group_account_user 1 1 1 1

BIN
dynamic_accounts_report/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
dynamic_accounts_report/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
dynamic_accounts_report/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
dynamic_accounts_report/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
dynamic_accounts_report/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
dynamic_accounts_report/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
dynamic_accounts_report/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
dynamic_accounts_report/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
dynamic_accounts_report/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
dynamic_accounts_report/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
dynamic_accounts_report/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
dynamic_accounts_report/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
dynamic_accounts_report/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
dynamic_accounts_report/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/approval_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/budget_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/export_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/magento_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/pos_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
dynamic_accounts_report/static/description/assets/modules/shopify_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/01_balance-sheet-report-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/02_balance-sheet-report -2-PDF.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/03_balance-sheet-report-3-xlsx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/04_balance-sheet-report-4-View-General-Ledger.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/05_balance-sheet report -5-View-source -move.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/06_bankbook-drill-down-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/07_bank-book-pdf -2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/08_bank-book-xlsx-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/09_filter-applied-in-bank-book.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/10_cash-book-drill-down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/11_journal-entry-from-cash-book.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/12_cash-flow-statement-detailed-view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/13_detailed-pdf-report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/14_detailed-xlsx-report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/15_various-report-levels-in-cash-flow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/16_daybook-drilldown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/17_journal-entry-from-daybook.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/18_general_ledger_drilldown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/19_general_ledger_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/20_partner-ageing-drill-down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/21_partner-ageing-with-filters-and-report-printing-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/22_partner-ledger-drill-down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/23_partner-ledger-with-filters-and-report-printing-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/24_profit-and-loss-report-with-filters-and-report-printing-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/25_journal-entry-view-from-general-ledger-wizard.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/26_general-ledger-wizard-with-drill-down-in-profit-and-loss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/27_view-source-move-from-general-ledger-wizard-in-profit-and-loss.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/28_trial-balance-report-with-filters-and-report-viewing-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/29-general-ledger-wizard-with-drill-down- and-view-source-move-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/30_Dynamic-Reports-Menu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/31_Financial-Report-Configuration-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/32_Financial-Report-Configuration-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/ageing filters applied.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/ageing pdf report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/ageing source move.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/ageing xlsx report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/balance sheet pdf report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/balance sheet report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/balance sheet xlsx report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/bank book journal entry.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/bank book pdf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/bank book report with filters and report viewing option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/bank book xlsx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/bankbook drill down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash book drill down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash book pdf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash book xlsx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash flow statement detailed view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash flow statement summary.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash flow statement with filters and report printing option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cash flow very deatiled xlsx.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

BIN
dynamic_accounts_report/static/description/assets/screenshots/cashbook report with filters and report printing option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save