Browse Source

[FIX] Scope of Trial Balance query within allowed account groups

pull/805/head
Andrea 3 years ago
parent
commit
a212bb6fa2
  1. 9
      account_financial_report/report/trial_balance.py

9
account_financial_report/report/trial_balance.py

@ -391,6 +391,9 @@ AND ra.report_id = %s
def _inject_account_group_values(self):
"""Inject report values for report_trial_balance_account"""
allowed_groups = self.env["account.group"].search([])
if not allowed_groups:
return
query_inject_account_group = """
INSERT INTO
report_trial_balance_account
@ -416,10 +419,14 @@ SELECT
accgroup.code_prefix,
accgroup.level
FROM
account_group accgroup"""
account_group accgroup
WHERE
accgroup.id in %s
"""
query_inject_account_params = (
self.id,
self.env.uid,
tuple(allowed_groups.ids),
)
self.env.cr.execute(query_inject_account_group,
query_inject_account_params)

Loading…
Cancel
Save