コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1108 ビュー

I'm trying to add a custom button open whatsapp in res.partner form. But everytime i clicked the button nothing happened.


here is my record and model :



class ResPartner(models.Model):

_inherit = 'res.partner'

def wa_btn
(self):

if self.mobile:

return
{

'type': 'ir.actions.act_url',
'name'
: 'Coba Whatsapp',
'url'
: "https://api.whatsapp.com/send?phone=" + self.mobile + "&text=Test_Whatsapp",
'target'
: 'new',
'context'
: self._context,
}

else:

return UserError(_("Error Chat WA"))


Sorry, about image code,

I don't know what went wrong.



アバター
破棄
関連投稿 返信 ビュー 活動
1
5月 24
43
5
11月 20
11164
0
11月 23
971
1
9月 19
4768
0
3月 15
4741