Skip to Content
Menu
This question has been flagged

Python code:

def openVideo(self):
video_url = self._context.get('url') # yes, this have a value
return {
'type': 'ir.actions.act_window',
'name': 'Video',
'res_model': 'ir.ui.view',
'view_mode': 'form',
'context': {
**self._context,
'default_video_url': video_url
},
'view_id': self.env.ref('tms_manual_sistema.video_popup').id,
'target': 'new',

}

Template:

<odoo>
<data>
<template id="tms_manual_sistema.video_popup">
<div>
<t t-if="context.get('default_video_url')">
<p>Video URL: <t t-esc="context.get('default_video_url')"/></p>
</t>
<t t-else="">
<p>No video URL provided</p>
</t>
</div>
<div class="o_notification o_notification_warning">
<div class="oe_video">
<iframe width="560" height="315" t-att-src="context.get('default_video_url')" frameborder="0" allowfullscreen="true"/>
</div>
</div>
</template>
</data>
</odoo>

Always shows "No Video URL provided". What i did wrong?

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 19
8563
0
Dec 24
1150
2
Jul 24
2797
2
Mar 22
11780
1
Mar 21
3276