From 1ca3b3df3421961caec3b747a364071c80f5c7da Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 17:14:58 +0700 Subject: initial commit --- dynamic_accounts_report/report/__init__.py | 7 + dynamic_accounts_report/report/ageing.py | 19 ++ dynamic_accounts_report/report/ageing.xml | 168 +++++++++++++ dynamic_accounts_report/report/cash_flow_report.py | 16 ++ .../report/cash_flow_report.xml | 263 +++++++++++++++++++++ dynamic_accounts_report/report/daybook.py | 17 ++ dynamic_accounts_report/report/daybook.xml | 121 ++++++++++ .../report/financial_report_template.xml | 165 +++++++++++++ .../report/financial_reports.py | 20 ++ dynamic_accounts_report/report/general_ledger.py | 20 ++ dynamic_accounts_report/report/general_ledger.xml | 153 ++++++++++++ dynamic_accounts_report/report/partner_ledger.py | 16 ++ dynamic_accounts_report/report/partner_ledger.xml | 155 ++++++++++++ dynamic_accounts_report/report/trial_balance.py | 18 ++ dynamic_accounts_report/report/trial_balance.xml | 129 ++++++++++ 15 files changed, 1287 insertions(+) create mode 100644 dynamic_accounts_report/report/__init__.py create mode 100644 dynamic_accounts_report/report/ageing.py create mode 100644 dynamic_accounts_report/report/ageing.xml create mode 100644 dynamic_accounts_report/report/cash_flow_report.py create mode 100644 dynamic_accounts_report/report/cash_flow_report.xml create mode 100644 dynamic_accounts_report/report/daybook.py create mode 100644 dynamic_accounts_report/report/daybook.xml create mode 100644 dynamic_accounts_report/report/financial_report_template.xml create mode 100644 dynamic_accounts_report/report/financial_reports.py create mode 100644 dynamic_accounts_report/report/general_ledger.py create mode 100644 dynamic_accounts_report/report/general_ledger.xml create mode 100644 dynamic_accounts_report/report/partner_ledger.py create mode 100644 dynamic_accounts_report/report/partner_ledger.xml create mode 100644 dynamic_accounts_report/report/trial_balance.py create mode 100644 dynamic_accounts_report/report/trial_balance.xml (limited to 'dynamic_accounts_report/report') diff --git a/dynamic_accounts_report/report/__init__.py b/dynamic_accounts_report/report/__init__.py new file mode 100644 index 0000000..5838e7a --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/ageing.py b/dynamic_accounts_report/report/ageing.py new file mode 100644 index 0000000..3764f7f --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/ageing.xml b/dynamic_accounts_report/report/ageing.xml new file mode 100644 index 0000000..ae70846 --- /dev/null +++ b/dynamic_accounts_report/report/ageing.xml @@ -0,0 +1,168 @@ + + + + + Partner Ageing + account.partner.ageing + qweb-pdf + dynamic_accounts_report.partner_ageing + dynamic_accounts_report.partner_ageing + + + \ No newline at end of file diff --git a/dynamic_accounts_report/report/cash_flow_report.py b/dynamic_accounts_report/report/cash_flow_report.py new file mode 100644 index 0000000..b8077ec --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/cash_flow_report.xml b/dynamic_accounts_report/report/cash_flow_report.xml new file mode 100644 index 0000000..b9c6d36 --- /dev/null +++ b/dynamic_accounts_report/report/cash_flow_report.xml @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + cash_flow + account.cash.flow + qweb-pdf + dynamic_accounts_report.cash_flow + dynamic_accounts_report.cash_flow + + \ No newline at end of file diff --git a/dynamic_accounts_report/report/daybook.py b/dynamic_accounts_report/report/daybook.py new file mode 100644 index 0000000..4af37ce --- /dev/null +++ b/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 \ No newline at end of file diff --git a/dynamic_accounts_report/report/daybook.xml b/dynamic_accounts_report/report/daybook.xml new file mode 100644 index 0000000..c3593de --- /dev/null +++ b/dynamic_accounts_report/report/daybook.xml @@ -0,0 +1,121 @@ + + + + + Day Book + account.day.book + qweb-pdf + dynamic_accounts_report.day_book + dynamic_accounts_report.day_book + + + \ No newline at end of file diff --git a/dynamic_accounts_report/report/financial_report_template.xml b/dynamic_accounts_report/report/financial_report_template.xml new file mode 100644 index 0000000..6bd2608 --- /dev/null +++ b/dynamic_accounts_report/report/financial_report_template.xml @@ -0,0 +1,165 @@ + + + + + + Financial Report + dynamic.balance.sheet.report + qweb-pdf + dynamic_accounts_report.balance_sheet + dynamic_accounts_report.balance_sheet + + + diff --git a/dynamic_accounts_report/report/financial_reports.py b/dynamic_accounts_report/report/financial_reports.py new file mode 100644 index 0000000..76c6bdd --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/general_ledger.py b/dynamic_accounts_report/report/general_ledger.py new file mode 100644 index 0000000..2572b6a --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/general_ledger.xml b/dynamic_accounts_report/report/general_ledger.xml new file mode 100644 index 0000000..63f8b95 --- /dev/null +++ b/dynamic_accounts_report/report/general_ledger.xml @@ -0,0 +1,153 @@ + + + + + + Report + account.general.ledger + qweb-pdf + dynamic_accounts_report.general_ledger + dynamic_accounts_report.general_ledger + + + \ No newline at end of file diff --git a/dynamic_accounts_report/report/partner_ledger.py b/dynamic_accounts_report/report/partner_ledger.py new file mode 100644 index 0000000..fe97bca --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/partner_ledger.xml b/dynamic_accounts_report/report/partner_ledger.xml new file mode 100644 index 0000000..fff1ba5 --- /dev/null +++ b/dynamic_accounts_report/report/partner_ledger.xml @@ -0,0 +1,155 @@ + + + + + + Partner ledger + account.partner.ledger + qweb-pdf + dynamic_accounts_report.partner_ledger + dynamic_accounts_report.partner_ledger + + + \ No newline at end of file diff --git a/dynamic_accounts_report/report/trial_balance.py b/dynamic_accounts_report/report/trial_balance.py new file mode 100644 index 0000000..bc33bbc --- /dev/null +++ b/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 diff --git a/dynamic_accounts_report/report/trial_balance.xml b/dynamic_accounts_report/report/trial_balance.xml new file mode 100644 index 0000000..90d53fb --- /dev/null +++ b/dynamic_accounts_report/report/trial_balance.xml @@ -0,0 +1,129 @@ + + + + + + + + Trial Balance + account.trial.balance + qweb-pdf + dynamic_accounts_report.trial_balance + dynamic_accounts_report.trial_balance + + + \ No newline at end of file -- cgit v1.2.3