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


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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 22
2004
0
set 21
2229
2
apr 20
5041
1
apr 24
1161
1
nov 19
5877