← Back to team overview

openerp-india team mailing list archive

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

 

** Attachment added: "Step for reproduce"
   https://bugs.launchpad.net/openobject-addons/+bug/1021151/+attachment/3213782/+files/account_TB.ogv

** Summary changed:

- local variable 'company_id' referenced before assignment
+ [trunk]local variable 'company_id' referenced before assignment

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
   Importance: Undecided => Medium

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)

-- 
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):
  Confirmed

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