Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
今天写多对多关系,结果报了这个错这是为啥?
问题已解决 fields.One2many 必须关联参数不然会报这个错误 错误写法: ocp_worker = fields.One2many('res.users', string="观察与沟通人员" , required=True) 正确写法: ocp_worker = fields.One2many('res.users','name', string="观察与沟通人员" , required=True)
一般不同name做外键,可能会有重复;
一般是在One2many 的表里建一个Many2one字段,
例如:ocp_worker_id = fields.Many2one('xxx')
然后用 ocp_worker_id 做外键