budget position should support view accounts

Bug #1070418 reported by Stéphane Bidoul (Acsone) on 2012-10-23
42
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 3
OpenERP Community Backports (Addons)
Status tracked in 7.0
6.1
Undecided
Unassigned
7.0
Undecided
Unassigned

Bug Description

Hello,

In account_budget module, when creating a budget position, the user can select view accounts and also accounts with consolidation children, in addition to normal accounts.

However, when viewing budgets with positions containing only view accounts, the "practical amount" field is always zero.

Since these type of accounts are accepted as budget positions, the system should take into account children and consolidation children when computing the practical amount.

How to reproduce:
1. install account_budget module
2. create some moves on a general account
3. create a budget position containing one *view* account -> debit and credit values are shown correctly in the budget position
4. create a budget with one line referring to the above budget position -> the practical amount is always 0

I attach a merge proposal.

-sbi

Related branches

Amit Parik (amit-parik) wrote :

Hello Stephane,

Could not understand your issue properly, please provide the steps to reproduce the issue also elaborate more on this,

Thanks and waiting for your reply

Changed in openobject-addons:
status: New → Incomplete
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Amit,

Thanks for looking into this.

I don't know how to explain the steps to reproduce differently.

The problem appears when you add accounts of type 'view' in a budget position. In that case, the 'practical amount' field in budget lines is always 0.

If you look at my attached merge proposal, you'll see the problem is in the _prac_amt() method in account_budget.py, where there is a SELECT FROM account_analytic_line WHERE general_account_id = ANY(acc_id). Without my MP, the acc_id values may refer to view accounts, which are never referred to from analytic lines.

Best regards,

-sbi

Amit Parik (amit-parik) wrote :

Hello Stephane,

I have checked the budget position with view type account with your given patch and without your patch but I seen the changes on Theoretical Amount not on the Practical Amount.

i.e Without your patch.
enter the 100 planned value with view type account on budget position then
planned value =100, Practical Amount=0.0, Theoretical Amount = 64.29

With your patch.
enter the 100 planned value with view type account on budget position then
planned value =100, Practical Amount=0.0, Theoretical Amount = 100

So please tell me your expected result as well as real example on it.

Thank you!

Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Amit,

Here is a more detailed procedure to reproduce.
- v7, new database, no demo data
- install budget management module
- select Belgium Accounting package
- install Accounting and Finance
- create and validate a customer invoice for 100€ on account "701000 Ventes en Belgique", and analytic account "My Analytic Account", with date 2012-12-21
- In Accounting > Configuration > Budgets, create a budget position named "My Position" and add account "701 Ventes de produits finis" to it. Account 701 is a view account including account 701000.
- In Accounting > Budgets, create a budget named "My Budget", with duration one month (December since we created the invoice in December)
- In the new budget, add a budget line for position "My Position", duration one month (December), analytic account "My Analytic Account" and planned amount 200€ then save
- -> planned amount = 200.00: ok
  -> theoretical amount = 133.33: ok
  -> practical amount = 0.00 NOK (should be 100.00, with my patch)

Note that setting the same analytic account on the invoice and budget position is very important.

-sbi

Changed in openobject-addons:
status: Incomplete → New
Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Gerald Ngui (g-nerald-b) wrote :

Checking to see if there is any update on the planned changes for this.
Thanks.
-g-

Stéphane Bidoul (Acsone) (sbi) wrote :

Gerald,

The attached merge proposal is in production at our site and works fine.

Regards,

-sbi

Changed in ocb-addons:
status: New → Fix Released
Amit Parik (amit-parik) on 2013-10-21
tags: added: budget
summary: - [6.1 / trunk] budget position should support view accounts
+ budget position should support view accounts
Changed in openobject-addons:
status: Confirmed → Fix Committed

FYI, same problem with analytical account was reported as Bug #1274892.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers