← Back to team overview

openerp-india team mailing list archive

[Bug 1021151] Re: [trunk]local variable 'company_id' referenced before assignment

 

landed in trunk in revision 7364

** Changed in: openobject-addons
       Status: Fix Committed => Fix Released

-- 
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 Released

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