Odoo 在同一模型上添加两个 Many2one 字段会导致错误

问题描述 投票:0回答:1

我需要在 res.partner 模型中添加两个 Many2one 字段,并且两个字段都链接到 res.partner。

class ResPartner(models.Model):
    _inherit = 'res.partner'
    
    field1 = fields.Many2one('res.partner')
    field2 = fields.Many2one('res.partner')

但这会导致错误:

psycopg2.errors.UndefinedFunction: operator does not exist: character varying = integer
LINE 2: ...rtner__field2" ON ("res_partner"."field2" = "res_par...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts. 

您知道此错误的原因吗?

谢谢

odoo odoo-17 many2one
1个回答
0
投票

好吧,这是一个拼写错误,现在可以了。感谢您的帮助!

© www.soinside.com 2019 - 2024. All rights reserved.