[account_budget] When computing theorical amount one (1) day is missing from elapsed days and total days

Bug #1279922 reported by hbto [Vauxoo] http://www.vauxoo.com
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

On runbot

http://7-0-30413.runbot.openerp.com/?db=7-0-30413-all&ts=1392313676667#id=4&view_type=form&model=crossovered.budget&action=603

Date of computation: 02/13/2014

Create a Budget: Budget 2014
from: 01/01/2014
to: 12/31/2014

Budget Lines:
Analytic Account | Budgetary Position | Start Date | End Date | Paid Date |Planned Amount | Practical Amount | Theoretical Amount | Percentage
Seagate P1 | Purchases | 02/01/2014 | 02/28/2014 | False | 28000.00 | 0.00 | >> 12444.44 << | 0.00

Theorical Amount : 12444.44

This value is wrong
[7.0] http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_budget/account_budget.py#L167
[trnk] http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_budget/account_budget.py#L165

These lines say:

theo_amt = float(elapsed.days / float(total.days)) * line.planned_amount

theo_amt = float( (02/13/2014 - 02/01/2014).days / float( ( 02/28/2014 - 02/01/2014).days )) * 28000

theo_amt = float( 12 / float( 27 )) * 28000

theo_amt = 12444.44

This should be like this:

theo_amt = float(( elapsed.days + 1) / float(total.days + 1)) * line.planned_amount

theo_amt = float( ((02/13/2014 - 02/01/2014).days + 1)/ float( ( 02/28/2014 - 02/01/2014).days + 1)) * 28000

theo_amt = float( 13 / float( 28 )) * 28000

theo_amt = 13000.00

Best Regards.

Tags: maintenance

Related branches

Rafael Silva (rsilvam-k)
Changed in openobject-addons:
status: New → Confirmed
description: updated
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Hi,

Thanks for the report.

This issue has been fixed in the branch: lp:~openerp-dev/openobject-addons/7.0-opw-606232-rgo by revision-id: <email address hidden> and revision#: 9966

Soon, the branch will be reviewed by our experts and will be integrated with main stable branch.

Thanks.

Changed in openobject-addons:
importance: Undecided → Low
status: Confirmed → Fix Committed
Revision history for this message
Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Hello,

The fix has been merged with main stable branch by revno: 9972 and revision-id: <email address hidden>.

Thanks.

Changed in openobject-addons:
status: Fix Committed → Fix Released
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.