Hello, i need a way to pass record's fields which contain variables to be used in iframe src any idea on how to do that?
Thank you in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello, i need a way to pass record's fields which contain variables to be used in iframe src any idea on how to do that?
Thank you in advance
From the looks of it QWEB statements does not work in form and tree views.
But this can be done with a computed HTML field on the model and adding it to your views.
Model:
tracking_number = fields.Char ("Tracking Number")
tracking_iframe = fields. Html ("Tracking Preview", sanitize = False, compute = 'get_html')
def get_html (self):
for record in self:
record.tracking_iframe = f '<iframe src = "http://dhl.com/en/express /tracking.html?AWB=} record.tracking_number}" />
View:
<field name = "tracking_number" />
<field name = "tracking_iframe" />
(In the compute function there should be curly brackets around ecord.tracking_number, forum editor is not accepting it. )
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
lip 17
|
4463 | ||
|
0
mar 15
|
3844 | ||
Pass field value to iframe src
Rozwiązane
|
|
2
sie 22
|
7584 | |
|
0
wrz 23
|
1060 | ||
|
0
lis 22
|
2977 |