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

送分小仙女□ 提交于 2019-12-10 22:45:29

问题


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?


回答1:


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

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




回答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.



来源:https://stackoverflow.com/questions/35748151/how-to-place-a-link-to-a-view-in-the-email-template-of-odoo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!