Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
112 Zobrazení

In an Email Template applied to Sales Orders, I’m using object.name (<t t-out="object.name">) in the body of the email to include the order number. Is it possible to make this a link to the Sales Order so the client can click through to view it? I assume I can wrap it in an <a href=""></a> tag, but I’m not clear on how to reference the object.name in this format.

Avatar
Zrušit
Nejlepší odpověď

Hi,


In Odoo email templates, you can mix QWeb/templating tags with HTML. Since object refers to the record (here, a sale.order), you can use its get_portal_url() method to generate the correct public link.


<a t-att-href="object.get_portal_url()">

    <t t-out="object.name"/>

</a>


This will render as something like:<a href="https://yourcompany.odoo.com/my/orders/1234">SO023</a>

So the customer sees SO023 as a link, and when they click it, it opens the portal view of that sales order.



Odoo also uses like this way.




Hope it helps



Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
úno 25
1149
5
pro 23
22326
1
dub 24
6338
4
zář 22
6135
2
čvn 22
3270