update ets

This commit is contained in:
Ivan Office
2023-11-12 23:18:59 +08:00
parent c1b3158268
commit 55d53533e4
2 changed files with 5 additions and 4 deletions

View File

@@ -39,7 +39,7 @@
{
'name': "odooAi Common Util and Tools,欧度智能基础核心优化",
'version': '16.23.10.30',
'version': '16.23.11.12',
'author': 'odooai.cn',
'category': 'Base',
'website': 'https://www.odooai.cn',

View File

@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
from odoo import api, models, tools, SUPERUSER_ID
from odoo import api, models, tools, SUPERUSER_ID, _
from odoo.modules.module import get_resource_path
from odoo.tools import view_validation
from odoo.tools.view_validation import _relaxng_cache, validate, _validators
from odoo.tools.safe_eval import safe_eval
import os
from lxml import etree
import logging
_logger = logging.getLogger(__name__)
@@ -17,13 +18,13 @@ def app_relaxng(view_type):
if view_type in ['tree', 'search']:
_file = get_resource_path('app_common', 'rng', '%s_view.rng' % view_type)
else:
_file = get_resource_path('base', 'rng', '%s_view.rng' % view_type)
_file = os.path.join('base', 'rng', '%s_view.rng' % view_type)
with tools.file_open(_file) as frng:
try:
relaxng_doc = etree.parse(frng)
_relaxng_cache[view_type] = etree.RelaxNG(relaxng_doc)
except Exception:
_logger.error('You can Ignore this. Failed to load RelaxNG XML schema for views validation')
_logger.error(_('You can Ignore this. Failed to load RelaxNG XML schema for views validation, file: %s' % _file))
_relaxng_cache[view_type] = None
return _relaxng_cache[view_type]