Ex:
work1_name = fields.Many2one('work1.model',string='Work1 Name')
field1 = fields.Integer(related='work1_name.work1_id',string='Work1 ID')
work2_name = fields.Many2one('work2.model',string='Work2 Name')
field2 = fields.Integer(related='work2_name.work2_id',string='Work2 ID')
需要获取field3=field1&;的值;字段2
如果字段1=12和字段2=20,则字段3=1220
尝试了此操作,但出现错误:
@api.depends("field1","field2")
def _comp_bondid(self):
self.bondid = (self.field1 or "")+" "+(self.field2 or "")
bondid = fields.Char(compute="_comp_bondid", store=True)
感谢您的帮助<;三,
更新修复
旧的:
新建:(在self.fields之前添加str)
相关问题 更多 >
编程相关推荐