From 2a5d095096de07cc2557577baae27cda9fb60cfe Mon Sep 17 00:00:00 2001 From: "pso (OpenERP)" Date: Wed, 13 Jul 2011 14:15:28 +0530 Subject: [PATCH] [IMP] account: Fixed issue of Configuration of COA wizard was not working without Extended view (case:6707) bzr revid: pso@tinyerp.com-20110713084528-xgl23qqxvicuvwm5 --- addons/account/installer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index 6f62b9869e9..125d4f604c6 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -63,7 +63,7 @@ class account_installer(osv.osv_memory): 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Your Bank and Cash Accounts'), 'sale_tax': fields.float('Sale Tax(%)'), 'purchase_tax': fields.float('Purchase Tax(%)'), - 'company_id': fields.many2one('res.company', 'Company', required=True), + 'company_id': fields.many2one('res.company', 'Company'), } def _default_company(self, cr, uid, context=None): @@ -579,6 +579,8 @@ 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: + raise osv.except_osv(_('UserError'), _('It seems that there is no company selected or your company 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')) for res in self.read(cr, uid, ids, context=context): if record.charts == 'configurable': fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))