Access Error when printing Aged Partner Balance

Bug #1187611 reported by Dawn Richardson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Medium
OpenERP's Framework R&D

Bug Description

To replicate: (using version 7.0-20130313-002537)
Note: these steps must be carried out exactly in this order, or you may not get the exact ids on particular object which trigger the error

- Create a new DB
- Install "Accounting and Finance" app. When finished do NOT install default COA in "Configure Accounting Data". Instead click 'x' in top right of page
- Go to Settings > Users, select 'Administrator' and under 'Access Rights', tick the Multi Companies box, save and refresh
- Go to Accounting > Configuration > Accounts > Accounts and set up four accounts
>> Code: "0", Name: "CompanyB", Internal Type: "view", Account Type "Root/View", Company: "Company B"
>> Code: "1", Name: "Receivables", Internal Type: "Receivable", Account Type "Receivable", Company: "Your Company"
>> Code: "2", Name: "Payables", Internal Type: "Payable", Account Type "Payable", Company: "Your Company"
>> Code: "3", Name: "Expenses", Internal Type: "General", Account Type "Expense", Company: "Your Company"
- Go to Accounting > Customers and create new customer; "TestCustomer", company: "Your company", Accounts Receivable: "1 Receivables", Accounts Payable: "2 Payables"
- Go to Settings > Companies and Create a second company, CompanyB
- Go to Accounting > Configuration > Accounts > Accounts and set up one more account
>> Code: "0", Name: "CompanyB", Internal Type: "view", Account Type "Root/View", Company: "Company B"
- Go to Settings > Users, select 'Adminstrator', change 'Company' to 'CompanyB' and under 'Access Rights', add 'CompanyB' to the list of allowed companies. Save and refresh.
- Create "tester" user, with access to CompanyB only. Under 'Application', give them access as 'Financial Manager' next to Accounting & Finance'. Finally, change their password and log in with that account
- Go to Accounting > Reports > Generic Reports > Aged Partner Balance. Click Print.
- The following error message is displayed:
"Access Denied

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: Partner, Operation: read)"

From my debugging, this is due to the 'aged.partner.balance' report having an object type of 'res.partner', yet data['ids'] is being assigned to a chart of account id in account/wizard/account_report_aged_trial_balance.py. As a result report_sxw tries to access the PARTNER of that chart of account id, as part of setting the context. This is already incorrect, but no error is thrown unless the partner happens to be one which the user does not have valid permissions to view.

This may seem like really specific steps to get this problem. But in our larger multi-company database, clashes between partner/account ids is far more common, and means we can never print an aged trial balance for many users.

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

Hello Dawn,

Would you please look at the lp:1073087 which is quite similar. The problem comes due to multi-company.
Would you please check the attached branch on lp:1073087 and let us know.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Dawn Richardson (r-dawn) wrote :

Hi Amit,
I have been participating in lp:1073087 discussion in the past, so I'm fairly certain that while this is the same error message it is NOT related to user vs partner company access issues. None of the fixes within that bug report fix this problem either.
Cheers,
Dawn

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

Amit, seeing as you went ahead and marked this as a duplicate anyway, can you please explain WHY you believe this bug is a duplicate, other than the same error message. More importantly, how do you fix it, seeing as none of the lp:1073087 fixes work?

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: Incomplete → Confirmed
affects: openobject-addons → openobject-server
Changed in openobject-server:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP's Framework R&D (openerp-dev-framework)
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.