一、建一个 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>