跳至内容
菜单
此问题已终结
969 查看

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?

形象
丢弃
相关帖文 回复 查看 活动
1
1月 19
8589
0
12月 24
1168
2
7月 24
2855
2
3月 22
11825
1
3月 21
3309