Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4347 Vues


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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
0
févr. 22
2011
0
sept. 21
2232
2
avr. 20
5043
1
avr. 24
1164
1
nov. 19
5882