summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Vora (OpenERP) <jvo@tinyerp.com>2011-07-14 18:33:52 +0530
committerJay Vora (OpenERP) <jvo@tinyerp.com>2011-07-14 18:33:52 +0530
commit4f3913dcddfa1d836bfa9bfbb02884ce6aa87623 (patch)
tree3bafe75ea226fabe180d9e8c49d1946d9ac73978
parent86c5801ba091cf54823b52a6cf0c985d4126233f (diff)
parent60be82c211c60ca73434fa3dfb4c45d1e3777369 (diff)
[MERGE] Merged Priyesh' branch for the fix which manages the accounting configuration for simplified Interface
bzr revid: jvo@tinyerp.com-20110714130352-bn5h3b61o5q1lk8s
-rw-r--r--addons/account/installer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/account/installer.py b/addons/account/installer.py
index 6f62b9869e9..9d514199cbe 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,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 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'))