Created
October 15, 2020 10:10
-
-
Save rvalyi/119e79ef4732a931d2d6e86b7127b493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/mis_builder/models/mis_report_instance.py | |
+++ b/mis_builder/models/mis_report_instance.py | |
@@ -374,6 +374,12 @@ class MisReportInstancePeriod(models.Model): | |
) | |
for m in many_ids: | |
filters.append((filter_name, "in", [m["id"]])) | |
+ elif filter_name == 'analytic_account_id': | |
+ # filter also on children analytic accounts | |
+ analytic_account = self.env['account.analytic.account'].browse(value) | |
+ analytic_ids = self.env['account.analytic.account'].search( | |
+ [('name', 'ilike', analytic_account.name + '%')]).ids | |
+ filters.append(('analytic_account_id', 'in', tuple(analytic_ids))) | |
else: | |
filters.append((filter_name, operator, value)) | |
return filters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment