Fiscal year is not correctly found in accounting reports with multi-company setup

Bug #1185275 reported by Dawn Richardson
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
7.0
Fix Released
Undecided
OpenERP Publisher's Warranty Team
Trunk
Confirmed
Low
OpenERP R&D Addons Team 3

Bug Description

To replicate: (using version 7.0-20130313-002537)
- Create a new DB
- Install Accounting & Finance app & run the wizard for a default chart of accounts/currency setup
- Go to Users > Adminstrator and update the access rights to the following: Multi-Companies=True.
- Refresh and then go to Settings > Companies and create a new company, 'Company B'
- Go to Settings > Configuration > Accounting, then under 'Chart of Accounts' choose Company B. Under that choose "Configurable Account Chart Template" as the template and click 'Apply'
- Go to Accounting > Reporting > Generic Reporting > Partners > Aged Partner Balance. Select '0 Company B' as the chart of accounts. Click 'Print'
- To following error occurs:
"ValidateError

Error occurred while validating the field(s) chart_account_id,fiscalyear_id,period_from,period_to: The fiscalyear, periods or chart of account chosen have to belong to the same company. "

This is because it is getting the fiscalyear_id of 'Your Company' and so the validation in account_report_common.py is failing!
It looks to me as if the domain filter on fiscal years only accounts for multiple companies if the active_model is 'account.account', which it won't be if the report is being run from the Reporting menu!

This is crippling our company's implementation right now and would appreciate it being looked into.

Tags: maintenance

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
tags: added: maintenance
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

One of your customer faced this bug and I have posted it to OpenERP support team. rmu-openerp is working on it.

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Here is the patch I received from OPW team. I haven't tested it yet.

Revision history for this message
Dawn Richardson (r-dawn) wrote :

I tested the patch in #2 and while it works for the steps in the description, it breaks on any database with more than one fiscalyear per company. For example, follow the steps in the description but before printing the report, add in a new fiscal year "2012" for CompanyB. Running the report now throws a "TypeError: str.split is not a function" error.

I proposed a similar fix yesterday (see the related branch above) which fixes the bug description issue and works for multiple fiscal years and companies. Feel free to test this fix and let me know if it works for everyone.

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

@r-dawn

We tested the patch #2 this afternoon and we faced the same error message as you: "TypeError: str.split is not a function"

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello guys,

Thank you for the report and review. The patch from Dawn Richardson looks good to me and I have merged it into addons 7.0. The patch from the OPW indeed had a problem when search returned more than on element.

revno: 9322 [merge]
revision-id: <email address hidden>

Regrads

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.