merged_beneficiary_ids = fields.Many2many(
'openg2p.beneficiary',
'merged_beneficiary_rel',
'retained_id',
'merged_id',
string="Merged Duplicates",
index=True,
context={'active_test': False},
help="Duplicate records that have been merged with this."
" Primary function is to allow to reference of merged records "
)
我想写入这个多个字段,并在odoo UI中显示合并id的一些特定字段(可能是firstname或lastname)。我拥有的数据是受益人记录,id将被保留和合并id
当您希望显示特定字段时,这适用于许多字段,您可以: 首先,将标记字段放入带有起始标记的×2many字段:
现在,您可以在字段内添加树标记,以创建此特定字段的特定列表:
最后的代码如下所示:
要将现有记录添加到集合中,请执行以下操作:
请检查x2many字段的操作文档,因为Odoo以一种特殊的方式处理它。 https://www.odoo.com/documentation/14.0/developer/reference/orm.html#odoo.models.Model.write
相关问题 更多 >
编程相关推荐