Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4342 Vistas


Hi Dears,


I am using Odoo 10. I am able to send the mail using python code. Now my requirement is to send two buttons approve and reject inside the mail. When user clicks approve button then the actual record in the database should approve. And reject button should also work in the same manner. How can I achieve this plz help. I tried below link

https://www.odoo.com/forum/help-1/question/how-to-approve-a-record-through-email-120980

I want to know what we have to send in href of a button or link. Then how will it call the appropriate function in model or controller to do some task there.




 


Avatar
Descartar
Mejor respuesta

Hi,

In the email template, you must send a dynamically link e.g.: http://localhost:8069/web/reset_password?token=qvNvtQUjoB4oiOBrWcjs&db=odoo12e_english and just add a controller to check when an user click the button in his inbox email.

e.g.:

<a href="${object.signup_url}" style="background-color: #875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px; font-size:13px;">
    Accept invitation
</a>
@http.route('/web/reset_password', type='http', auth='public', website=True, sitemap=False)
def web_auth_reset_password(self, *args, **kw):
# Your code here...

Best regards!

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
feb 22
2001
0
sept 21
2227
2
abr 20
5039
1
abr 24
1161
1
nov 19
5874