[account_budget] crossovered_budget_report fetches practical amount over wrong period

Bug #1100396 reported by Niels Huylebroeck
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 3

Bug Description

When inside a budget we have multiple lines describing different periods for the same analytic account the calculation for the practically spent amount is queried X amount times, each of these queries uses the period defined in the wizard.

Assume following budget lines:
Date From | Date To | Analytic Account | Budgeted amount
2009-01-01 | 2009-12-31 | 300 | 500
2010-01-01 | 2010-12-31 | 300 | 700
2011-01-01 | 2011-12-31 | 300 | 1100
2012-01-01 | 2012-12-31 | 300 | 1500
2013-01-01 | 2013-12-31 | 300 | 2000

We then assume an analytic entry as follows :
Date | Amount | Analytic Account
2009-06-13 | 450 | 300

The resulting report if you run it with dates : 2009-01-01 to 2010-12-31
it will show that you have used 2700 out of the available 1200.

The reason it's 2700 is because there are 6 budget lines with analytic account id 300 and 6x450 = 2700.

Each time it is querying how much was spent for each budget line it specifies a date via the context['wizard_date_from'] and context['wizard_date_to'] and it passes the dates we passed, so when querying every budget line it actually asks, how much was spent between '2009-01-01' and '2010-12-31' whereas it should ask, how much was spent in the period covered by the budget line.

Tags: budget

Related branches

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Niels,

Thanks for the good trace and branch.

I have faced the same problem on 7.0 as well as trunk also.

Thanks again!

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Amit Parik (amit-parik)
tags: added: budget
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Niels Huylebroeck,

Thanks for reporting and contributing, this bug has been solved for trunk in branch :
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1100396-bde/+merge/199999
with following :

Revision ID : <email address hidden>
Revision Number : 9025

Once reviewed by experts it will be merged in addons soon.

Thanks & Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.