From 55d53533e4d8c7dbf6255228bea505cdc45dafc1 Mon Sep 17 00:00:00 2001 From: Ivan Office Date: Sun, 12 Nov 2023 23:18:59 +0800 Subject: [PATCH] update ets --- app_common/__manifest__.py | 2 +- app_common/models/ir_ui_view.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app_common/__manifest__.py b/app_common/__manifest__.py index 5ebb03dc..601c2c18 100644 --- a/app_common/__manifest__.py +++ b/app_common/__manifest__.py @@ -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', diff --git a/app_common/models/ir_ui_view.py b/app_common/models/ir_ui_view.py index 1163b15e..37a86815 100644 --- a/app_common/models/ir_ui_view.py +++ b/app_common/models/ir_ui_view.py @@ -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]