odoo17 ir.actions.client + iframe

一、建一个 owl Component 组建

建js路径: exte_addons/my_hostel/static/src/js/web_report.js

/** @odoo-module */
import { registry} from '@web/core/registry';
// import { useService } from "@web/core/utils/hooks";
import { Component } from "@odoo/owl";
export class Dashboard extends Component {
	setup(){
		console.log("testing odoo ir.actions.client + iframe");
	}
}
Dashboard.template = "WebReportPurchaseMain"
registry.category("actions").add("my_hostel.main", Dashboard)

建xml路径: exte_addons/my_hostel/static/src/xml/web_report.xml

<?xml version="1.0" encoding="UTF-8"?>

<templates xml:space="preserve">
    <t t-name="WebReportPurchaseMain">
                       <iframe src="https://www.baidu.com/"

                               width="100%" height="100%"

                               marginwidth="0" marginheight="0"

                               frameborder="no" scrolling="no"

                               allowfullscreen="allowfullscreen"

                               style="border-width:0px; ">

                       </iframe>
    </t>
</templates>

二、建一个xml视图,并配置的菜单目录下

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="web_purchase_report_action" model="ir.actions.client">
        <field name="name">my.iframe</field>
        <field name="tag">my_hostel.main</field>
    </record>

    <menuitem id="web_report_testing1111" name="webiframe" parent="hostel_main_menu"
        action="web_purchase_report_action" groups="my_hostel.group_hostel_manager"
        sequence="1"/>
</odoo>

三、效果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值