[FIX] fix the verification of view with relaxng to work with base as a zip module

bzr revid: christophe@tinyerp.com-20090109162535-n79h7d457jib1hzx
This commit is contained in:
Christophe Simonis 2009-01-09 17:25:35 +01:00
parent 5fc9c91289
commit 6a5bb6904f
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ def _check_xml(self, cr, uid, ids, context={}):
for view in self.browse(cr, uid, ids, context):
eview = etree.fromstring(view.arch.encode('utf8'))
frng = tools.file_open(os.path.join('base','rng','view.rng'))
relaxng = etree.RelaxNG(file=frng)
relaxng_doc = etree.parse(frng)
relaxng = etree.RelaxNG(relaxng_doc)
if not relaxng.validate(eview):
logger = netsvc.Logger()
logger.notifyChannel('init', netsvc.LOG_ERROR, 'The view does not fit the required schema !')