问题
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