我需要在 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.
您知道此错误的原因吗?
谢谢
好吧,这是一个拼写错误,现在可以了。感谢您的帮助!