How to place a link to a view in the email templat

2019-07-14 21:56发布

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?

2条回答
对你真心纯属浪费
2楼-- · 2019-07-14 22:23

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.

查看更多
三岁会撩人
3楼-- · 2019-07-14 22:32

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

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

查看更多
登录 后发表回答