[MERGE] Merged Priyesh' branch for the fix which manages the accounting configuration...
authorJay Vora (OpenERP) <jvo@tinyerp.com>
Thu, 14 Jul 2011 13:03:52 +0000 (18:33 +0530)
committerJay Vora (OpenERP) <jvo@tinyerp.com>
Thu, 14 Jul 2011 13:03:52 +0000 (18:33 +0530)
bzr revid: jvo@tinyerp.com-20110714130352-bn5h3b61o5q1lk8s

1  2 
addons/account/installer.py

@@@ -579,6 -579,9 +579,11 @@@ class account_installer(osv.osv_memory)
          ir_values = self.pool.get('ir.values')
          record = self.browse(cr, uid, ids, context=context)[0]
          company_id = record.company_id
++        
+         if not company_id:
+             user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
 -            raise osv.except_osv(_('Warning'), _('It seems that there is no company selected or %s already has an accounting configuration. If you want to set the accounting setting for a other company than the main one, please make sure that you belong to the group Usability/Extended View') % (user.company_id.name))
++            raise osv.except_osv(_('Warning'), _('It seems that there is no company selected or %s already has an accounting configuration. If you want to set the accounting configuration for any company other than the main one, please make sure that you belong to the group Usability/Extended View') % (user.company_id.name))
++        
          for res in self.read(cr, uid, ids, context=context):
              if record.charts == 'configurable':
                  fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))