@ -0,0 +1,44 @@ |
|||||
|
Dynamic Financial Reports |
||||
|
========================= |
||||
|
* Dynamic financial reports for Odoo 16 community editions |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
- www.odoo.com/documentation/16.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 |
||||
|
(v16) 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>`__ |
||||
|
|
@ -0,0 +1,79 @@ |
|||||
|
# -*- 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 |
||||
|
from . import models |
||||
|
from odoo import api, SUPERUSER_ID |
||||
|
|
||||
|
|
||||
|
def _load_account_details_post_init_hook(cr, registry): |
||||
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
||||
|
for record in env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_other_income0': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', '=', 'income_other')]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
elif record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.financial_report_cost_of_revenue': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', '=', 'expense_direct_cost')]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
elif record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_operating_income0': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', 'in', ('equity_unaffected', 'income'))]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
elif record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_expense0': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', 'in', |
||||
|
('expense', 'expense_depreciation'))]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
elif record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_assets0': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', 'in', ( |
||||
|
'asset_receivable', 'asset_non_current', |
||||
|
'asset_current', |
||||
|
'asset_prepayments', 'asset_fixed', |
||||
|
'asset_cash'))]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
elif record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_liability0': |
||||
|
for rec in env['account.account'].search( |
||||
|
[('account_type', 'in', ( |
||||
|
'liability_payable', 'equity', |
||||
|
'liability_current', |
||||
|
'liability_non_current', |
||||
|
'liability_credit_card'))]): |
||||
|
record.write({"account_ids": [(4, rec.id)]}) |
||||
|
|
||||
|
|
||||
|
def unlink_records_financial_report(cr, registry): |
||||
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
||||
|
for record in env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
record.write({"account_ids": [(5, 0, 0)]}) |
@ -0,0 +1,81 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-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 V16', |
||||
|
'version': '16.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', |
||||
|
'views/reports_config_view.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', |
||||
|
'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, |
||||
|
'post_init_hook': '_load_account_details_post_init_hook', |
||||
|
'uninstall_hook': 'unlink_records_financial_report' |
||||
|
} |
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import controllers |
@ -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 = http.serialize_exception(e) |
||||
|
error = { |
||||
|
'code': 200, |
||||
|
'message': 'Odoo Server Error', |
||||
|
'data': se |
||||
|
} |
||||
|
return request.make_response(html_escape(json.dumps(error))) |
@ -0,0 +1,6 @@ |
|||||
|
## Module <dynamic_accounts_report> |
||||
|
|
||||
|
#### 02.09.2022 |
||||
|
#### Version 16.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Odoo 16 dynamic financial reports |
@ -0,0 +1,2 @@ |
|||||
|
from . import move_line |
||||
|
from . import account_account_custom |
@ -0,0 +1,107 @@ |
|||||
|
from odoo import models, api |
||||
|
|
||||
|
|
||||
|
class AccountAccountCustom(models.Model): |
||||
|
_inherit = 'account.account' |
||||
|
|
||||
|
@api.model |
||||
|
def create(self, vals): |
||||
|
res = super(AccountAccountCustom, self).create(vals) |
||||
|
if res.account_type.startswith("asset"): |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_assets0': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
elif res.account_type.startswith( |
||||
|
"liability") or res.account_type == "equity": |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_liability0': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
elif res.account_type in ['expense', 'expense_depreciation']: |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_expense0': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
elif res.account_type == "expense_direct_cost": |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.financial_report_cost_of_revenue': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
elif res.account_type in ['income', 'equity_unaffected']: |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_operating_income0': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
elif res.account_type == 'income_other': |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_other_income0': |
||||
|
record.write({"account_ids": [(4, res.id)]}) |
||||
|
return res |
||||
|
|
||||
|
@api.onchange('account_type') |
||||
|
def onchange_account_type(self): |
||||
|
for record in self.env['account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
for rec in record.account_ids: |
||||
|
if rec.id == self._origin.id: |
||||
|
print("function called") |
||||
|
record.write({"account_ids": [(3, rec.id)]}) |
||||
|
if self.account_type.startswith("asset"): |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_assets0': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
||||
|
elif self.account_type.startswith( |
||||
|
"liability") or self.account_type == "equity": |
||||
|
print('function_called...........') |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_liability0': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
||||
|
elif self.account_type in ['expense', |
||||
|
'expense_depreciation']: |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_expense0': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
||||
|
elif self.account_type == "expense_direct_cost": |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.financial_report_cost_of_revenue': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
||||
|
elif self.account_type in ['income', 'equity_unaffected']: |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_operating_income0': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
||||
|
elif self.account_type == 'income_other': |
||||
|
for record1 in self.env[ |
||||
|
'account.financial.report'].search( |
||||
|
[('type', '=', 'account_type')]): |
||||
|
if record1.get_metadata()[0].get( |
||||
|
'xmlid') == 'base_accounting_kit.account_financial_report_other_income0': |
||||
|
record1.write( |
||||
|
{"account_ids": [(4, self._origin.id)]}) |
@ -0,0 +1,103 @@ |
|||||
|
from odoo import fields, models, api, _ |
||||
|
from odoo.http import request |
||||
|
import ast |
||||
|
|
||||
|
from odoo.exceptions import AccessError, UserError, AccessDenied |
||||
|
|
||||
|
class AccountMoveLine(models.Model): |
||||
|
_inherit = "account.move.line" |
||||
|
|
||||
|
"""Function is updated to avoid conflict for new and old odoo V15 addons""" |
||||
|
|
||||
|
|
||||
|
@api.model |
||||
|
def _query_get(self, domain=None): |
||||
|
self.check_access_rights('read') |
||||
|
|
||||
|
context = dict(self._context or {}) |
||||
|
domain = domain or [] |
||||
|
if not isinstance(domain, (list, tuple)): |
||||
|
domain = ast.literal_eval(domain) |
||||
|
|
||||
|
date_field = 'date' |
||||
|
if context.get('aged_balance'): |
||||
|
date_field = 'date_maturity' |
||||
|
if context.get('date_to'): |
||||
|
domain += [(date_field, '<=', context['date_to'])] |
||||
|
if context.get('date_from'): |
||||
|
if not context.get('strict_range'): |
||||
|
domain += ['|', (date_field, '>=', context['date_from']), ('account_id.include_initial_balance', '=', True)] |
||||
|
elif context.get('initial_bal'): |
||||
|
domain += [(date_field, '<', context['date_from'])] |
||||
|
else: |
||||
|
domain += [(date_field, '>=', context['date_from'])] |
||||
|
|
||||
|
if context.get('journal_ids'): |
||||
|
domain += [('journal_id', 'in', context['journal_ids'])] |
||||
|
|
||||
|
state = context.get('state') |
||||
|
if state and state.lower() != 'all': |
||||
|
domain += [('parent_state', '=', state)] |
||||
|
|
||||
|
# if context.get('company_id'): |
||||
|
# domain += [('company_id', '=', context['company_id'])] |
||||
|
# elif context.get('allowed_company_ids'): |
||||
|
# domain += [('company_id', 'in', self.env.companies.ids)] |
||||
|
# else: |
||||
|
# domain += [('company_id', '=', self.env.company.id)] |
||||
|
|
||||
|
if context.get('reconcile_date'): |
||||
|
domain += ['|', ('reconciled', '=', False), '|', ('matched_debit_ids.max_date', '>', context['reconcile_date']), ('matched_credit_ids.max_date', '>', context['reconcile_date'])] |
||||
|
|
||||
|
if context.get('account_tag_ids'): |
||||
|
domain += [('account_id.tag_ids', 'in', context['account_tag_ids'].ids)] |
||||
|
|
||||
|
if context.get('account_ids'): |
||||
|
domain += [('account_id', 'in', context['account_ids'].ids)] |
||||
|
|
||||
|
# if context.get('analytic_tag_ids'): |
||||
|
# domain += [('analytic_tag_ids', 'in', context['analytic_tag_ids'].ids)] |
||||
|
|
||||
|
if context.get('analytic_account_ids'): |
||||
|
domain += [('analytic_account_id', 'in', context['analytic_account_ids'].ids)] |
||||
|
|
||||
|
if context.get('partner_ids'): |
||||
|
domain += [('partner_id', 'in', context['partner_ids'].ids)] |
||||
|
|
||||
|
if context.get('partner_categories'): |
||||
|
domain += [('partner_id.category_id', 'in', context['partner_categories'].ids)] |
||||
|
|
||||
|
company_ids = self.get_current_company_value() |
||||
|
|
||||
|
|
||||
|
domain += [('company_id', 'in', company_ids)] |
||||
|
|
||||
|
where_clause = "" |
||||
|
where_clause_params = [] |
||||
|
tables = '' |
||||
|
if domain: |
||||
|
domain.append(('display_type', 'not in', ('line_section', 'line_note'))) |
||||
|
domain.append(('parent_state', '!=', 'cancel')) |
||||
|
|
||||
|
query = self._where_calc(domain) |
||||
|
|
||||
|
# Wrap the query with 'company_id IN (...)' to avoid bypassing company access rights. |
||||
|
self._apply_ir_rules(query) |
||||
|
|
||||
|
tables, where_clause, where_clause_params = query.get_sql() |
||||
|
return tables, where_clause, where_clause_params |
||||
|
|
||||
|
|
||||
|
def get_current_company_value(self): |
||||
|
|
||||
|
cookies_cids = [int(r) for r in request.httprequest.cookies.get('cids').split(",")] \ |
||||
|
if request.httprequest.cookies.get('cids') \ |
||||
|
else [request.env.user.company_id.id] |
||||
|
for company_id in cookies_cids: |
||||
|
if company_id not in self.env.user.company_ids.ids: |
||||
|
cookies_cids.remove(company_id) |
||||
|
if not cookies_cids: |
||||
|
cookies_cids = [self.env.company.id] |
||||
|
if len(cookies_cids) == 1: |
||||
|
cookies_cids.append(0) |
||||
|
return cookies_cids |
@ -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 |
@ -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 |
@ -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> |
@ -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 |
@ -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['id'] == res['id']" 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['id'] == res['id']" 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> |
@ -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 |
@ -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> |
@ -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') > 2"> |
||||
|
<t t-set="style" t-value="'font-weight: normal;'"/> |
||||
|
</t> |
||||
|
<t t-if="not a.get('level') > 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['id'] == a.get('account')"> |
||||
|
<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> |
@ -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 |
@ -0,0 +1,19 @@ |
|||||
|
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 |
@ -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> |
@ -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 |
@ -0,0 +1,157 @@ |
|||||
|
<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> |
@ -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 |
@ -0,0 +1,135 @@ |
|||||
|
<odoo> |
||||
|
|
||||
|
<template id="dynamic_accounts_report.trial_balance"> |
||||
|
<!-- <t t-call="web.html_container">--> |
||||
|
<!-- <t t-foreach="docs" t-as="doc">--> |
||||
|
<t t-call="dynamic_accounts_report.trial_balance1" t-lang="request.env.user.lang"/> |
||||
|
<!-- </t>--> |
||||
|
<!-- </t>--> |
||||
|
</template> |
||||
|
|
||||
|
<template id="dynamic_accounts_report.trial_balance1"> |
||||
|
<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> |
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 193 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 149 KiB |
After Width: | Height: | Size: 168 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 255 KiB |
After Width: | Height: | Size: 237 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 140 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 234 KiB |