mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update ets
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': "odooAi Common Util and Tools,欧度智能基础核心优化",
|
'name': "odooAi Common Util and Tools,欧度智能基础核心优化",
|
||||||
'version': '16.23.10.30',
|
'version': '16.23.11.12',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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.modules.module import get_resource_path
|
||||||
from odoo.tools import view_validation
|
from odoo.tools import view_validation
|
||||||
from odoo.tools.view_validation import _relaxng_cache, validate, _validators
|
from odoo.tools.view_validation import _relaxng_cache, validate, _validators
|
||||||
from odoo.tools.safe_eval import safe_eval
|
from odoo.tools.safe_eval import safe_eval
|
||||||
|
|
||||||
|
import os
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import logging
|
import logging
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -17,13 +18,13 @@ def app_relaxng(view_type):
|
|||||||
if view_type in ['tree', 'search']:
|
if view_type in ['tree', 'search']:
|
||||||
_file = get_resource_path('app_common', 'rng', '%s_view.rng' % view_type)
|
_file = get_resource_path('app_common', 'rng', '%s_view.rng' % view_type)
|
||||||
else:
|
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:
|
with tools.file_open(_file) as frng:
|
||||||
try:
|
try:
|
||||||
relaxng_doc = etree.parse(frng)
|
relaxng_doc = etree.parse(frng)
|
||||||
_relaxng_cache[view_type] = etree.RelaxNG(relaxng_doc)
|
_relaxng_cache[view_type] = etree.RelaxNG(relaxng_doc)
|
||||||
except Exception:
|
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
|
_relaxng_cache[view_type] = None
|
||||||
return _relaxng_cache[view_type]
|
return _relaxng_cache[view_type]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user