diff --git a/addons/account_budget/report/analytic_account_budget_report.py b/addons/account_budget/report/analytic_account_budget_report.py index ea904caeda1..52ee37783fe 100644 --- a/addons/account_budget/report/analytic_account_budget_report.py +++ b/addons/account_budget/report/analytic_account_budget_report.py @@ -34,34 +34,27 @@ class analytic_account_budget_report(report_sxw.rml_parse): result=[] accounts = self.pool.get('account.analytic.account').browse(self.cr, self.uid, [object.id], self.context.copy()) + c_b_lines_obj=self.pool.get('crossovered.budget.lines') for account_id in accounts: res={} - budget_lines=[] b_line_ids=[] for line in account_id.crossovered_budget_line: b_line_ids.append(line.id) + if not b_line_ids: + return [] + bd_lines_ids = ','.join([str(x) for x in b_line_ids]) d_from=form['date_from'] d_to=form['date_to'] - query="select id from crossovered_budget_lines where id in ("+ str(bd_lines_ids) + ")"# AND '"+ str(d_from) +"'<=date_from AND date_from