openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #22617
[Bug 1110189] Re: tax report error in multi company
Hello! Thanks Atul for your feedback.
I finally found the cause of the error. In
account/wizard/account_vat.py, by doing this change..
...
def create_vat(self, cr, uid, ids, context=None):
if context is None:
context = {}
- datas = {'ids': []}
+ datas = {'ids': context.get('active_ids', [])}
That is, replacing "datas = {'ids': context.get('active_ids', [])}" with
datas = {'ids': []} the error is solved.
While debugging with a user with permissions to work in company 1 on
this sentence I found that context.get('active_ids', []) returned a tax
code object that belonged company 2! How could that tax code from
company 2 get into the context? No idea.... The fact is that report
account.vat.declaration is then called passing in 'datas' this object,
which the system attempts to read in account_tax_report.py, in function
set_context and throws the error.
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1110189
Title:
tax report error in multi company
Status in OpenERP Addons (modules):
New
Bug description:
Hello,
I have set-up two companies, unlinked to each other.
When I login in one of the companies with a user that has been set-up
specifically for that company, and attempt to run the tax report, the
system throws an error message indicating that the user does not have
permission to read the object tax.code.
I'm debugging, and find that the account.tax.report report attempts to
read during the call to _set_context to a tax code that belongs to the
other company.
When I login with a user on the other company, the report is run with
no errors.
So, looks like the report attempts to read a random tax code during
the initial set-up regardless of what company does the tax code
belongs to....
Any ideas??
Regards,
Jordi
www.eficent.com
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1110189/+subscriptions
References