跳至内容
菜单
此问题已终结
2 回复
1514 查看

I have a field called crm (selection from table crm.lead)

I need to find away that when I select a crm name return the partner name of this stage in put it 

in many2one field called partner_name

形象
丢弃
最佳答案

Is this what you are asking?

@api.onchange('crm')
def _onchange_crm_name(self):
if self.crm.parent_id:
self.partner_name = self.crm.partner_id.id

形象
丢弃
最佳答案

Hi,

Either you can define an on change function for the crm field or created a related field to achive this.

Thanks

形象
丢弃