mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
[app_common] v18 file_path
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user