From 20a99ae12949cbe473b21f750492d2a55e3ea091 Mon Sep 17 00:00:00 2001 From: fka-odoo Date: Wed, 6 Aug 2014 17:42:30 +0530 Subject: [PATCH] [IMP] account_budget: added date filter in print budget report Fixes #1743, opw 611307 --- addons/account_budget/account_budget.py | 4 ---- addons/account_budget/report/crossovered_budget_report.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/account_budget/account_budget.py b/addons/account_budget/account_budget.py index c20871ed65e..ac79ca1799d 100644 --- a/addons/account_budget/account_budget.py +++ b/addons/account_budget/account_budget.py @@ -120,10 +120,6 @@ class crossovered_budget_lines(osv.osv): raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % ustr(line.general_budget_id.name)) date_to = line.date_to date_from = line.date_from - if context.has_key('wizard_date_from'): - date_from = context['wizard_date_from'] - if context.has_key('wizard_date_to'): - date_to = context['wizard_date_to'] if line.analytic_account_id.id: cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date " "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND " diff --git a/addons/account_budget/report/crossovered_budget_report.py b/addons/account_budget/report/crossovered_budget_report.py index 4a3b632a8de..43411795c8a 100644 --- a/addons/account_budget/report/crossovered_budget_report.py +++ b/addons/account_budget/report/crossovered_budget_report.py @@ -89,7 +89,7 @@ class budget_report(report_sxw.rml_parse): } result.append(res) - line_ids = c_b_lines_obj.search(self.cr, self.uid, [('id', 'in', budget_ids), ('analytic_account_id','=',an_ids[i][0])]) + line_ids = c_b_lines_obj.search(self.cr, self.uid, [('id', 'in', budget_ids), ('analytic_account_id','=',an_ids[i][0]), ('date_to', '>=', d_from), ('date_from', '<=', d_to)]) line_id = c_b_lines_obj.browse(self.cr, self.uid, line_ids) tot_theo = tot_pln = tot_prac = tot_perc = 0.00