跳至內容
選單
此問題已被標幟
2 回覆
1521 瀏覽次數

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

頭像
捨棄