taxes reports fails if there are many companies/taxes

Bug #993961 reported by Leonardo Pistone
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP Publisher's Warranty Team

Bug Description

observed in v6. server 3616 addons 5218 both with gtk and web client

This bug is not very obvious to reproduce. If you have a database with many tax_codes, for example one with 6 companies, all with their respective charts, with 'demo user' the 'taxes report' fails with an
Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: Tax Code).

The problem arises here:

http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/view/head:/account/wizard/account_vat.py#L47

What happens is that data['ids'] contains the ID of something that is not a tax code. If that ID is big, so that there isn't a tax code with that ID, the report works fine. This happens with a clean DB with demo data.

On the other hand, if you have many tax codes and many companies, you could get a situation where the tax code with that ID exists but it is not readable by the user. That causes the permission error above and the report fails.

You can manually reproduce the situation by creating a second company (no need to actually set up a chart of accounts) and then put a pdb to find out what is context['active_ids'] there.

Then, create via SQL a tax_code with id = context['active_ids'] above, and company = the second company.

The tax report should fail.

Another option to reproduce that is to create 5 or 6 companies, set up the accounts and taxes on each of them, try the report and have luck.

Of course, if that is not quite clear I can provide more info, or a video, or a dump.

Thanks!

Tags: maintenance

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
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.