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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
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
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?
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.
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Mar 15
|
3817 |