summaryrefslogtreecommitdiff
path: root/bin/addons
diff options
context:
space:
mode:
authorhda@tinyerp.com <>2008-11-10 10:42:26 +0530
committerhda@tinyerp.com <>2008-11-10 10:42:26 +0530
commit47d75d03e524c19352010677e50f2aa55000aede (patch)
tree625665eb6987b73ad02b666c4289761d935d0a4f /bin/addons
parent5211b0803c7a6544c63798d8705152785c6c7b9d (diff)
parent808d552be8360d02485572b2543f757a32980f23 (diff)
solved import zip problem (ref:nch)
bzr revid: hda@tinyerp.com-20081110051226-ovyliknq3w8mmxr6
Diffstat (limited to 'bin/addons')
-rw-r--r--bin/addons/__init__.py12
-rw-r--r--bin/addons/base/ir/ir_ui_view.py10
2 files changed, 16 insertions, 6 deletions
diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py
index 49a254758c8..6f9a3d85850 100644
--- a/bin/addons/__init__.py
+++ b/bin/addons/__init__.py
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@@ -176,7 +176,7 @@ def create_graph(module_list, force=None):
continue
terp_file = get_module_resource(module, '__terp__.py')
if not terp_file: continue
- if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path):
+ if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'):
try:
info = eval(tools.file_open(terp_file).read())
except:
@@ -206,7 +206,7 @@ def create_graph(module_list, force=None):
later.add(package)
packages.append((package, deps, datas))
packages.pop(0)
-
+
for package in later:
logger.notifyChannel('init', netsvc.LOG_ERROR, 'addon:%s:Unmet dependency' % package)
@@ -236,7 +236,7 @@ def load_module_graph(cr, graph, status=None, **kwargs):
sys.stdout.flush()
pool = pooler.get_pool(cr.dbname)
modules = pool.instanciate(m, cr)
-
+
cr.execute('select id from ir_module_module where name=%s', (m,))
mid = int(cr.rowcount and cr.fetchone()[0] or 0)
@@ -277,7 +277,7 @@ def load_module_graph(cr, graph, status=None, **kwargs):
cr.execute("update ir_module_module set state='installed' where state in ('to upgrade', 'to install') and id=%d", (mid,))
cr.commit()
-
+
# Update translations for all installed languages
modobj = pool.get('ir.module.module')
if modobj:
@@ -289,7 +289,7 @@ def load_module_graph(cr, graph, status=None, **kwargs):
cr.execute("""select model,name from ir_model where id not in (select model_id from ir_model_access)""")
for (model,name) in cr.fetchall():
logger.notifyChannel('init', netsvc.LOG_WARNING, 'addon:object %s (%s) has no access rules!' % (model,name))
-
+
pool = pooler.get_pool(cr.dbname)
cr.execute('select * from ir_model where state=%s', ('manual',))
for model in cr.dictfetchall():
diff --git a/bin/addons/base/ir/ir_ui_view.py b/bin/addons/base/ir/ir_ui_view.py
index f34999e059e..d10d1082709 100644
--- a/bin/addons/base/ir/ir_ui_view.py
+++ b/bin/addons/base/ir/ir_ui_view.py
@@ -73,6 +73,16 @@ class view(osv.osv):
(_check_xml, 'Invalid XML for View Architecture!', ['arch'])
]
+ def create(self, cr, uid, vals, context={}):
+ if 'inherit_id' in vals:
+ obj=self.browse(cr,uid,vals['inherit_id'])
+ if not obj.model==vals['model']:
+ raise Exception("Inherited view model [%s] and \
+ \n\n base view model [%s] do not match \
+ \n\n It should be same as base view model " \
+ %(vals['model'],obj.model))
+ return super(view,self).create(cr, uid, vals, context={})
+
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'):
if not isinstance(ids, (list, tuple)):