Hello All
i have create an action in server action to open whatsapp API and send a message with share link here is my code:
if not record.partner_id.mobile:
raise UserError('No mobile number found for the selected partner.')
else:
# create message
message = "Hello %s,Your quotation %s amounting in %s %s is ready for review. Here's the link to view it: https://erp.gyc.com/mail/view?model=sale.order&res_id=%s&access_token=%s Regards," % (record.partner_id.name, record.name, record.amount_total, record.currency_id.name, record.id, record.access_token)
# create action
action = {
'name': "WhatsApp",
'type': 'ir.actions.act_url',
'url': "https://api.whatsapp.com/send?phone=%s&text=%s" % (record.partner_id.mobile, message),
'target': 'new',
}
everything is working but in the share link in two places we have "&" and the link will trime from & and result is like bellow:
Hello Kamranlpr,Your quotation S02317 amounting in 1050.0 is ready for review. Here's the link to view it: https://erp.gyc.com/mail/view?model=sale.order
so ID and token will trime.
i was wondering if anyone can help me to solve the problem.