Skip to content

Commit 82611af

Browse files
committed
Merge PR #1483 into 16.0
Signed-off-by pedrobaeza
2 parents e9c5437 + 6da6c5a commit 82611af

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

account_financial_report/report/general_ledger.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,16 @@ def _get_taxes_data(self, taxes_ids):
5050
)
5151
return taxes_data
5252

53-
def _get_account_type_domain(self, grouped_by):
53+
def _get_account_type_domain(self, grouped_by, model_name="account.move.line"):
5454
"""To avoid set all possible types, set in or not in as operator of the types
5555
we are interested in. In v15 we used the internal_type field (type of
5656
account.account.type)."""
57-
at_op = "in" if grouped_by != "taxes" else "not in"
57+
at_op = "=" if grouped_by != "taxes" else "!="
58+
fname = "is_account_reconcile"
59+
if model_name == "account.account":
60+
fname = "reconcile"
5861
return [
59-
("account_type", at_op, ["asset_receivable", "liability_payable"]),
62+
(fname, at_op, True),
6063
]
6164

6265
def _get_acc_prt_accounts_ids(self, company_id, grouped_by):
@@ -65,7 +68,7 @@ def _get_acc_prt_accounts_ids(self, company_id, grouped_by):
6568
return []
6669
accounts_domain = [
6770
("company_id", "=", company_id),
68-
] + self._get_account_type_domain(grouped_by)
71+
] + self._get_account_type_domain(grouped_by, "account.account")
6972
acc_prt_accounts = self.env["account.account"].search(accounts_domain)
7073
return acc_prt_accounts.ids
7174

@@ -83,8 +86,8 @@ def _get_initial_balances_bs_ml_domain(
8386
domain += [("date", "<", date_from)]
8487
accounts = self.env["account.account"].search(accounts_domain)
8588
domain += [("account_id", "in", accounts.ids)]
86-
if acc_prt and grouped_by != "none":
87-
domain += self._get_account_type_domain(grouped_by)
89+
if acc_prt:
90+
domain += self._get_account_type_domain(grouped_by, "account.move.line")
8891
return domain
8992

9093
def _get_initial_balances_pl_ml_domain(

0 commit comments

Comments
 (0)