Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2704 มุมมอง

I'm trying to create a dynamic link to access activity's related document within an email template.

As an acitivity is related to document id and document model, I have made the current code to reach the desired document:
​".. a href="/web#id=${object.res_id}&model=${object.res_model_id.model}&view_type=form" class="btn btn-primary" target="_blank">Related document

** edit: I didn't finish the code with tags () since it was taken as a link and not as text

At the moment I get to the desired document, but the menu for that view doesn't load.

I believe I'll have to add something like: 

"​.. &menu_id=${'way to get menu id'}"


Any ideas how to get that menu id dynamically for each model?.

Thanks in advance,
Rodrigo

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This does not work in Odoo 18. This has to be possible...

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

To incorporate a dynamic URL parameter in a link or button within an email template in Odoo v14, you can follow these steps:

1. Open the email template you wish to modify.
2. Identify the link or button to which you want to add the dynamic URL parameter.
3. Utilize the "Insert/Edit Link" or "Insert/Edit Button" button located in the email editor toolbar.
4. Within the URL field, input the base URL intended for the link or button, including any static parameters.
5. Append the dynamic URL parameter to the end of the URL, adhering to the Odoo expression syntax "{{...}}".
6. Within the double curly braces, specify the name of the field or variable intended for use as the dynamic URL parameter.
7. Save the modifications made to the email template.


Hope it helps

อวตาร
ละทิ้ง

This does not work in Odoo 18. This has to be possible...

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 24
1493
2
ธ.ค. 22
2641
0
ก.ค. 21
32
0
ต.ค. 24
3990
how odoo take values in mail.template? แก้ไขแล้ว
3
พ.ย. 19
6794