-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
General Ledger can be computed only if selected company have only one unaffected earnings account.
+
+
diff --git a/account_financial_report_qweb/wizard/trial_balance_wizard.py b/account_financial_report_qweb/wizard/trial_balance_wizard.py
index bd05233c..17abdfdd 100644
--- a/account_financial_report_qweb/wizard/trial_balance_wizard.py
+++ b/account_financial_report_qweb/wizard/trial_balance_wizard.py
@@ -49,6 +49,22 @@ class TrialBalanceReportWizard(models.TransientModel):
string='Filter partners',
)
+ not_only_one_unaffected_earnings_account = fields.Boolean(
+ readonly=True,
+ string='Not only one unaffected earnings account'
+ )
+
+ @api.onchange('company_id')
+ def onchange_company_id(self):
+ """Handle company change."""
+ account_type = self.env.ref('account.data_unaffected_earnings')
+ count = self.env['account.account'].search_count(
+ [
+ ('user_type_id', '=', account_type.id),
+ ('company_id', '=', self.company_id.id)
+ ])
+ self.not_only_one_unaffected_earnings_account = count != 1
+
@api.onchange('date_range_id')
def onchange_date_range_id(self):
"""Handle date range change."""
diff --git a/account_financial_report_qweb/wizard/trial_balance_wizard_view.xml b/account_financial_report_qweb/wizard/trial_balance_wizard_view.xml
index db7be23e..ba2ceb9e 100644
--- a/account_financial_report_qweb/wizard/trial_balance_wizard_view.xml
+++ b/account_financial_report_qweb/wizard/trial_balance_wizard_view.xml
@@ -10,34 +10,47 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
Trial Balance can be computed only if selected company have only one unaffected earnings account.
+
+