Skip to Content
Menu
This question has been flagged
1104 Rodiniai

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.



Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
geg. 24
43
5
lapkr. 20
11160
0
lapkr. 23
970
1
rugs. 19
4766
0
kov. 15
4736