[FIX] app_common: security

This commit is contained in:
Chill
2024-03-11 18:29:32 +08:00
parent 8d09aab854
commit 410d5142f2
3 changed files with 11 additions and 3 deletions

View File

@@ -39,7 +39,7 @@
{
'name': "odooai Odooapp Common Func",
'version': '15.23.09.28',
'version': '15.24.03.11',
'author': 'odooai.cn',
'category': 'Base',
'website': 'https://www.odooai.cn',

View File

@@ -52,6 +52,12 @@ EXCLU_FIELDS = [
class Base(models.AbstractModel):
_inherit = 'base'
@api.model
def _app_check_sys_op(self):
if self.env.user.has_group('base.group_erp_manager'):
return True
return False
@api.model
def _get_normal_fields(self):
f_list = []
@@ -100,8 +106,10 @@ class Base(models.AbstractModel):
return dt.astimezone(pytz_timezone).strftime(return_format)
@api.model
def get_image_from_url(self, url):
def _get_image_from_url(self, url):
# 返回这个图片的base64编码
if not self._app_check_sys_op():
return False
return get_image_from_url(url)
def get_ua_type(self):

View File

@@ -4,7 +4,7 @@
<h2 class="oe_slogan"> </h2>
<h3 class="oe_slogan"> </h3>
<div class="oe_row">
<h3>Lastest update: v15.23.09.28</h3>
<h3>Lastest update: v15.24.03.11</h3>
<div class="row">
<img class="oe_demo oe_screenshot img img-fluid" style="max-height: 100%;" src="banner.png">
</div>