taxes reports fails if there are many companies/taxes
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:
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[
Then, create via SQL a tax_code with id = context[
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!
Related branches
- Jay Vora (Serpent Consulting Services) (community): Approve
- Rifakat Husen (OpenERP) (community): Needs Resubmitting
- Leonardo Pistone (community): Needs Fixing
- Xavier ALT: Pending requested
- Naresh(OpenERP): Pending requested
-
Diff: 87 lines (+13/-27)2 files modifiedaccount/report/account_tax_report.py (+10/-25)
account/wizard/account_vat.py (+3/-2)
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 |