fix odoo customize

This commit is contained in:
ivan deng
2021-07-24 21:05:31 +08:00
parent ada4d45c5c
commit bbdefaccf5
2 changed files with 3 additions and 3 deletions

View File

@@ -23,7 +23,7 @@
{ {
'name': 'odoo 14,13 Customize OEM(Boost, Data reset)', 'name': 'odoo 14,13 Customize OEM(Boost, Data reset)',
'version': '13.21.03.31', 'version': '13.21.07.24',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Productivity', 'category': 'Productivity',
'website': 'https://www.sunpop.cn', 'website': 'https://www.sunpop.cn',

View File

@@ -132,11 +132,11 @@ class ResConfigSettings(models.TransientModel):
t_name = obj._table t_name = obj._table
sql = "delete from %s" % t_name sql = "delete from %s" % t_name
# 增加多公司处理 # 增加多公司处理, 要删除无公司的
if hasattr(self.env[obj_name], 'company_id'): if hasattr(self.env[obj_name], 'company_id'):
field = self.env[obj_name]._fields['company_id'] field = self.env[obj_name]._fields['company_id']
if not field.related or field.store: if not field.related or field.store:
sql = "%s where company_id=%d" % (sql, self.env.company.id) sql = "%s where company_id=%d or company_id isnull" % (sql, self.env.company.id)
_logger.warning('remove_app_data where add company_id: %s' % obj_name) _logger.warning('remove_app_data where add company_id: %s' % obj_name)
try: try:
self._cr.execute(sql) self._cr.execute(sql)