summaryrefslogtreecommitdiff
path: root/bin/tools/convert.py
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2008-09-03 11:47:31 +0200
committerChristophe Simonis <christophe@tinyerp.com>2008-09-03 11:47:31 +0200
commitfe13a01ae9809a0f2c9297a079d5ba00d7d2b2ce (patch)
treeca58d0319e926c35781697c1b4a852578748dd09 /bin/tools/convert.py
parent2e585a4899488cc744702f266180a0ece580ba80 (diff)
views: id's with a dot must refer a installed module
bzr revid: christophe@tinyerp.com-20080903094731-5j3mgzsvmzzabeay
Diffstat (limited to 'bin/tools/convert.py')
-rw-r--r--bin/tools/convert.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/tools/convert.py b/bin/tools/convert.py
index 7588ca2f1cc..d62648f4830 100644
--- a/bin/tools/convert.py
+++ b/bin/tools/convert.py
@@ -226,12 +226,16 @@ class xml_import(object):
def _test_xml_id(self, xml_id):
id = xml_id
if '.' in xml_id:
- assert len(id.split('.'))==2, """The ID reference '"%s" must contains
+ module, id = xml_id.split('.', 1)
+ assert '.' not in id, """The ID reference "%s" must contains
maximum one dot. They are used to refer to other modules ID, in the
form: module.record_id""" % (xml_id,)
- base, id = xml_id.split('.')
+ if module != self.module:
+ modcnt = self.pool.get('ir.module.module').search_count(self.cr, self.uid, ['&', ('name', '=', module), ('state', 'in', ['installed'])])
+ assert modcnt == 1, """The ID "%s" refer to an uninstalled module""" % (xml_id,)
+
if len(id) > 64:
- self.logger.notifyChannel('init', netsvc.LOG_ERROR, 'id: %s is to long (max: 64)'%xml_id)
+ self.logger.notifyChannel('init', netsvc.LOG_ERROR, 'id: %s is to long (max: 64)'% (id,))
def _tag_delete(self, cr, rec, data_node=None):
d_model = rec.getAttribute("model")