openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #13333
[Bug 1021151] Re: [trunk]local variable 'company_id' referenced before assignment
Hello,
I have fixed the problem in lp:~openerp-commiter/openobject-addons/trunk-bug-1021151-cha branch,
It will be available soon in lp:openobject-addons.
Revision No: 6983
Revision ID: cha@xxxxxxxxxxx-20120705130455-iy00wseff3lroj25
Thanks.
Ajay Chauhan
** Branch linked: lp:~openerp-commiter/openobject-addons/trunk-
bug-1021151-cha
** Changed in: openobject-addons
Status: In Progress => Fix Committed
--
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/1021151
Title:
[trunk]local variable 'company_id' referenced before assignment
Status in OpenERP Addons (modules):
Fix Committed
Bug description:
When there's no Chart of Accounts defined, and trying to print Trial
Balance, UnboundLocalError exception is thrown:
File "/openerp/addons/account/wizard/account_report_common.py", line 35, in onchange_chart_id
return {'value': {'company_id': company_id}}
UnboundLocalError: local variable 'company_id' referenced before assignment
Very simple and easily notable bug:
def onchange_chart_id(self, cr, uid, ids, chart_account_id=False, context=None):
if chart_account_id:
company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id
return {'value': {'company_id': company_id}}
Cheers
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1021151/+subscriptions
References