mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
[FIX] app_odoo_customize: security
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'odoo17 Tweak,Ai Employee,Boost,Customize All in One. Customize,UI,Boost,Security,Data',
|
'name': 'odoo17 Tweak,Ai Employee,Boost,Customize All in One. Customize,UI,Boost,Security,Data',
|
||||||
'version': '15.23.12.28',
|
'version': '15.24.03.11',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'category': 'Productivity',
|
'category': 'Productivity',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
ir_config.set_param("app_ribbon_name", self.app_ribbon_name or "*odooai.cn")
|
ir_config.set_param("app_ribbon_name", self.app_ribbon_name or "*odooai.cn")
|
||||||
|
|
||||||
def set_module_url(self):
|
def set_module_url(self):
|
||||||
|
if not self._app_check_sys_op():
|
||||||
|
raise UserError(_('Not allow.'))
|
||||||
sql = "UPDATE ir_module_module SET website = '%s' WHERE license like '%s' and website <> ''" % (self.app_enterprise_url, 'OEEL%')
|
sql = "UPDATE ir_module_module SET website = '%s' WHERE license like '%s' and website <> ''" % (self.app_enterprise_url, 'OEEL%')
|
||||||
try:
|
try:
|
||||||
self._cr.execute(sql)
|
self._cr.execute(sql)
|
||||||
@@ -115,7 +117,9 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# 清数据,o=对象, s=序列
|
# 清数据,o=对象, s=序列
|
||||||
def remove_app_data(self, o, s=[]):
|
def _remove_app_data(self, o, s=[]):
|
||||||
|
if not self._app_check_sys_op():
|
||||||
|
raise UserError(_('Not allow.'))
|
||||||
for line in o:
|
for line in o:
|
||||||
# 检查是否存在
|
# 检查是否存在
|
||||||
try:
|
try:
|
||||||
@@ -167,7 +171,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'sale',
|
'sale',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_product(self):
|
def remove_product(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -178,7 +182,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'product.product',
|
'product.product',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_product_attribute(self):
|
def remove_product_attribute(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -187,7 +191,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'product.attribute',
|
'product.attribute',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_pos(self):
|
def remove_pos(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -200,12 +204,12 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'pos.',
|
'pos.',
|
||||||
]
|
]
|
||||||
res = self.remove_app_data(to_removes, seqs)
|
res = self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
# 更新要关帐的值,因为 store=true 的计算字段要重置
|
# 更新要关帐的值,因为 store=true 的计算字段要重置
|
||||||
|
|
||||||
try:
|
try:
|
||||||
statement = self.env['account.bank.statement'].sudo().search([])
|
statement = self.env['account.bank.statement'].search([])
|
||||||
for s in statement:
|
for s in statement:
|
||||||
s._end_balance()
|
s._end_balance()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -223,7 +227,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'purchase.',
|
'purchase.',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_expense(self):
|
def remove_expense(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -236,7 +240,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'hr.expense.',
|
'hr.expense.',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_mrp(self):
|
def remove_mrp(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -255,7 +259,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
seqs = [
|
seqs = [
|
||||||
'mrp.',
|
'mrp.',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_mrp_bom(self):
|
def remove_mrp_bom(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -264,7 +268,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'mrp.bom',
|
'mrp.bom',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_inventory(self):
|
def remove_inventory(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -293,7 +297,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'product.tracking.default',
|
'product.tracking.default',
|
||||||
'WH/',
|
'WH/',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_account(self):
|
def remove_account(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -313,7 +317,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'hr.expense.sheet',
|
'hr.expense.sheet',
|
||||||
'account.move',
|
'account.move',
|
||||||
]
|
]
|
||||||
res = self.remove_app_data(to_removes, [])
|
res = self._remove_app_data(to_removes, [])
|
||||||
|
|
||||||
# extra 更新序号
|
# extra 更新序号
|
||||||
domain = [
|
domain = [
|
||||||
@@ -422,7 +426,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
pass # raise Warning(e)
|
pass # raise Warning(e)
|
||||||
|
|
||||||
seqs = []
|
seqs = []
|
||||||
res = self.remove_app_data(to_removes, seqs)
|
res = self._remove_app_data(to_removes, seqs)
|
||||||
self.env.company.write({'chart_template_id': False})
|
self.env.company.write({'chart_template_id': False})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -435,7 +439,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'project.project',
|
'project.project',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_quality(self):
|
def remove_quality(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -454,7 +458,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'quality.alert',
|
'quality.alert',
|
||||||
# 'quality.point',
|
# 'quality.point',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_quality_setting(self):
|
def remove_quality_setting(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -466,7 +470,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'quality.reason',
|
'quality.reason',
|
||||||
'quality.tag',
|
'quality.tag',
|
||||||
]
|
]
|
||||||
return self.remove_app_data(to_removes)
|
return self._remove_app_data(to_removes)
|
||||||
|
|
||||||
def remove_website(self):
|
def remove_website(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -487,7 +491,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
# 'website',
|
# 'website',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_message(self):
|
def remove_message(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -497,7 +501,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'mail.activity',
|
'mail.activity',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_workflow(self):
|
def remove_workflow(self):
|
||||||
to_removes = [
|
to_removes = [
|
||||||
@@ -506,7 +510,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
'wkf.instance',
|
'wkf.instance',
|
||||||
]
|
]
|
||||||
seqs = []
|
seqs = []
|
||||||
return self.remove_app_data(to_removes, seqs)
|
return self._remove_app_data(to_removes, seqs)
|
||||||
|
|
||||||
def remove_all_biz(self):
|
def remove_all_biz(self):
|
||||||
self.remove_account()
|
self.remove_account()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<section class="container app">
|
<section class="container app">
|
||||||
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h2 class="oe_slogan">This is a Long Term Support Apps.Update: v16.5.23.09.30</h2>
|
<h2 class="oe_slogan">This is a Long Term Support Apps.Update: v15.24.03.11</h2>
|
||||||
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">1. Deletes Odoo label in footer</li>
|
<li class="list-group-item">1. Deletes Odoo label in footer</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user