From 429b7a3707bd0e55d4c5a1a48be79b0f3850437b Mon Sep 17 00:00:00 2001 From: mpanarin Date: Thu, 19 Jul 2018 15:13:30 +0300 Subject: [PATCH] [ADD] 11.0 account_financial_report: journals filter for trial balance --- account_financial_report/report/trial_balance.py | 2 ++ account_financial_report/wizard/trial_balance_wizard.py | 4 ++++ account_financial_report/wizard/trial_balance_wizard_view.xml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/account_financial_report/report/trial_balance.py b/account_financial_report/report/trial_balance.py index d1d3994f..18e0acb3 100644 --- a/account_financial_report/report/trial_balance.py +++ b/account_financial_report/report/trial_balance.py @@ -28,6 +28,7 @@ class TrialBalanceReport(models.TransientModel): company_id = fields.Many2one(comodel_name='res.company') filter_account_ids = fields.Many2many(comodel_name='account.account') filter_partner_ids = fields.Many2many(comodel_name='res.partner') + filter_journal_ids = fields.Many2many(comodel_name='account.journal') show_partner_details = fields.Boolean() hierarchy_on = fields.Selection([('computed', 'Computed Accounts'), ('relation', 'Child Accounts')], @@ -187,6 +188,7 @@ class TrialBalanceReportCompute(models.TransientModel): 'company_id': self.company_id.id, 'filter_account_ids': [(6, 0, account_ids.ids)], 'filter_partner_ids': [(6, 0, self.filter_partner_ids.ids)], + 'filter_journal_ids': [(6, 0, self.filter_journal_ids.ids)], 'fy_start_date': self.fy_start_date, } diff --git a/account_financial_report/wizard/trial_balance_wizard.py b/account_financial_report/wizard/trial_balance_wizard.py index a4fd4d73..e40db9b1 100644 --- a/account_financial_report/wizard/trial_balance_wizard.py +++ b/account_financial_report/wizard/trial_balance_wizard.py @@ -54,6 +54,9 @@ class TrialBalanceReportWizard(models.TransientModel): comodel_name='res.partner', string='Filter partners', ) + journal_ids = fields.Many2many( + comodel_name="account.journal", + ) not_only_one_unaffected_earnings_account = fields.Boolean( readonly=True, @@ -157,6 +160,7 @@ class TrialBalanceReportWizard(models.TransientModel): 'company_id': self.company_id.id, 'filter_account_ids': [(6, 0, self.account_ids.ids)], 'filter_partner_ids': [(6, 0, self.partner_ids.ids)], + 'filter_journal_ids': [(6, 0, self.partner_ids.ids)], 'fy_start_date': self.fy_start_date, 'hierarchy_on': self.hierarchy_on, 'show_partner_details': self.show_partner_details, diff --git a/account_financial_report/wizard/trial_balance_wizard_view.xml b/account_financial_report/wizard/trial_balance_wizard_view.xml index 8ac3e9ba..b9acac3c 100644 --- a/account_financial_report/wizard/trial_balance_wizard_view.xml +++ b/account_financial_report/wizard/trial_balance_wizard_view.xml @@ -28,6 +28,8 @@