[app_common] v18 file_path

This commit is contained in:
Chill
2024-12-13 16:54:37 +08:00
parent 3149247eb1
commit 448b541824
3 changed files with 6 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
from odoo import api, models, tools, SUPERUSER_ID
from odoo.modules.module import get_resource_path
from odoo.tools import file_open
from odoo.tools import misc
from odoo.tools import view_validation
from odoo.tools.view_validation import _relaxng_cache, validate, _validators
from odoo.tools.safe_eval import safe_eval
@@ -15,9 +16,9 @@ def app_relaxng(view_type):
if view_type not in _relaxng_cache:
# tree, search 特殊
if view_type in ['list', 'search']:
_file = get_resource_path('app_common', 'rng', '%s_view.rng' % view_type)
_file = misc.file_path('app_common/rng/%s_view.rng' % view_type)
else:
_file = get_resource_path('base', 'rng', '%s_view.rng' % view_type)
_file = misc.file_path('base/rng/%s_view.rng' % view_type)
with tools.file_open(_file) as frng:
try:
relaxng_doc = etree.parse(frng)