Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1095 Visualizzazioni

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.



Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mag 24
43
5
nov 20
11160
0
nov 23
967
1
set 19
4764
0
mar 15
4732