Wrong currency on bank statement in multi company setup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Committed
|
Medium
|
OpenERP R&D Addons Team 3 |
Bug Description
The currency on the bank statement does not reflect the currency of the journal selected but it displays the currency of the company the current user is working in.
Steps to reproduce:
1. create new database with demo data
2. install Accounting & Finance module
3. go to Settings >> General Settings and enable 'Manage multiple companies'
4. go to Settings >> Companies >> edit 'OpenERP Editor' and change the currency to RUB; do the same for 'OpenERP IN' and change the currency to INR
5. go to Settings >> Accounting and set any chart of accounts to 'OpenERP Editor' and 'OpenERP IN' one at a time. I used the same CoA for both companies, but different CoAs can be used as that doesn't matter in this case
6. create user login 'UserA' and under Access Rights grant it Accountant role to the accounting module; also enable 'Multiple Companies' setting; set Company field to 'OpenERP Editor' and add 'OpenERP Editor' to Allowed Companies.
7. log in as UserA and create a new bank statement but for 'OpenERP IN'
8. to do so, change the journal to 'OpenERP India Bank (INR)', observe that the Currency field has changed to INR which is correct behavior for now (see screenshot 1).
9. optionally change the date/period and add line items
10. save the bank statement and note that the Currency has changed to RUB, which is the default company for UserA (!) (see screenshot 2)
I've located the problem in code file 'account_
Currently the code checks, if there is a currency specified for the journal. If not, it takes the currency of the company of the user currently logged in. It doesn't take into account the currency of the company the journal is linked to.
The current code block looks like this (line 73):
-------
default_currency = res_users_
for statement in self.browse(cursor, user, ids, context=context):
if not currency:
-------
And according to my opinion it should look like this:
-------
default_currency = res_users_
for statement in self.browse(cursor, user, ids, context=context):
if not currency:
if not currency:
-------
Hope this helps,
Danijel
Related branches
- Amit Parik (community): Approve
- OpenERP Core Team: Pending requested
-
Diff: 14 lines (+1/-3)1 file modifiedaccount/account_bank_statement.py (+1/-3)
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | In Progress → Fix Committed |
Hi Priyanka,
I still can reproduce this bug in version 7.0-20130318- 002339. Can you please tell me where the fix has been committed to?
Thank you.