Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4346 Tampilan


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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Feb 22
2011
0
Sep 21
2232
2
Apr 20
5042
1
Apr 24
1163
1
Nov 19
5879