当我尝试升级ODOO13中的代码时,我在ODOO12中有一个与Pycomat库相关的代码 它给了我以下错误:
if isinstance(res_ids, pycompat.integer_types):
AttributeError: module 'odoo.tools.pycompat' has no attribute 'integer_types'
我的python代码如下:
def generate_email(self, res_ids, fields=None):
self.ensure_one()
multi_mode = True
if isinstance(res_ids, pycompat.integer_types):
res_ids = [res_ids]
multi_mode = False
if fields is None:
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'email_bcc', 'reply_to',
'scheduled_date']
res_ids_to_templates = self.get_email_template(res_ids)
那么,我需要在这段代码中做什么样的更改呢
提前谢谢
integer_types
是一个垫片,用于保持与Python 2代码的兼容性。这个垫片(和其他垫片)已经在Odoo13中安装您应该直接与
int
进行比较相关问题 更多 >
编程相关推荐