mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update common
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'odoo 15,14,13 Customize OEM(Boost, Data reset)',
|
'name': 'odoo 15,14,13 Customize OEM(Boost, Data reset)',
|
||||||
'version': '13.22.01.25',
|
'version': '13.22.03.13',
|
||||||
'author': 'Sunpop.cn',
|
'author': 'Sunpop.cn',
|
||||||
'category': 'Productivity',
|
'category': 'Productivity',
|
||||||
'website': 'https://www.sunpop.cn',
|
'website': 'https://www.sunpop.cn',
|
||||||
|
|||||||
@@ -113,6 +113,17 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def clear_table(self, t_name):
|
||||||
|
sql = "delete from %s" % t_name
|
||||||
|
# 增加多公司处理
|
||||||
|
try:
|
||||||
|
self._cr.execute(sql)
|
||||||
|
self._cr.commit()
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
_logger.warning('remove data error: %s,%s', t_name, e)
|
||||||
|
return False
|
||||||
|
|
||||||
# 清数据,o=对象, s=序列
|
# 清数据,o=对象, s=序列
|
||||||
def remove_app_data(self, o, s=[]):
|
def remove_app_data(self, o, s=[]):
|
||||||
for line in o:
|
for line in o:
|
||||||
@@ -130,14 +141,9 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
t_name = obj_name.replace('.', '_')
|
t_name = obj_name.replace('.', '_')
|
||||||
else:
|
else:
|
||||||
t_name = obj._table
|
t_name = obj._table
|
||||||
|
# todo: 每个项目具体优化
|
||||||
|
self.clear_table(t_name)
|
||||||
|
|
||||||
sql = "delete from %s" % t_name
|
|
||||||
# 增加多公司处理
|
|
||||||
try:
|
|
||||||
self._cr.execute(sql)
|
|
||||||
self._cr.commit()
|
|
||||||
except Exception as e:
|
|
||||||
_logger.warning('remove data error: %s,%s', line, e)
|
|
||||||
# 更新序号
|
# 更新序号
|
||||||
for line in s:
|
for line in s:
|
||||||
domain = ['|', ('code', '=ilike', line + '%'), ('prefix', '=ilike', line + '%')]
|
domain = ['|', ('code', '=ilike', line + '%'), ('prefix', '=ilike', line + '%')]
|
||||||
|
|||||||
Reference in New Issue
Block a user