Akhil Mathew
Akhil Mathew

Reputation: 1659

How to place a link to a view in the email template of odoo

In my custom room booking application, when user book a room a mail will send to the admin. In the mail template, there is an approve button. Once the admin clicks the approve button, it should redirect to the approval form view. How can I do that by placing a link in the email template?

Upvotes: 2

Views: 3996

Answers (2)

You can put in your template a text ${ctx['url']} and then render send template with template.with_context(url=url).send_mail(self.id). ${ctx['url']} will be replaced with url you passed along with context.

Upvotes: 1

Andrei Boyanov
Andrei Boyanov

Reputation: 2393

The url you have to compose is of the following form:

http://odoo.server.com/web?db=#id=&view_type=form&model=

Upvotes: 2

Related Questions