Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get the current URL in email template?

By
ahhhhj399
on 10/31/16, 9:24 PM 155 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?

4

Hilar AK

--Hilar AK--
829
| 5 2 7
Italy
--Hilar AK--


Hilar AK
On 11/9/16, 5:59 AM

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

2

Nilmar Shereef

--Nilmar Shereef--
811
| 4 3 7
Calicut, India
--Nilmar Shereef--

Python Developer. Android Developer. .Net Developer

Nilmar Shereef
On 11/2/16, 3:27 AM

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.

0
SREERAJ MDM
On 11/1/16, 12:50 AM

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 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/31/16, 9:24 PM
Seen: 155 times
Last updated: 11/9/16, 10:49 PM