Skip to Content
Menu
This question has been flagged
3 Replies
11251 Views

I want to write the current URL in a email template, for example if I'm inside a sale order or a purchase order, <a href="http://www.uushairextensions.com"> hair extensions </a>I would expect the link that points to that document, how can I do that?

Avatar
Discard
Best Answer

In your sale order just try to write the current url by saving to a field and fetch on email template that field as object.yoururlfieldmake the field a compute field

so the function should contain

@api.one
def yyy(self):
    from openerp import http
    self.yourfiledname = str(http.request.httprequest).split("'")[1].split("'")[0]

just fetch the field value in your email template

Avatar
Discard

Hi Hilar. I have the same requirement (get backend url for current sale.order) as the OP, but I'm using V11 CE. Can you suggest code I can try to write the url to a custom field?

Best Answer

Hi,
current_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')

Use the above code to get current URL in python file
Hope this may help you.

Avatar
Discard
Best Answer

you might see the answers in https://www.odoo.com/forum/help-1/question/how-to-get-current-url-in-odoo-9-110141#answer-110150 

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 15
3817