Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5 Trả lời
15539 Lượt xem

Hi,

I need to integrate external app with odoo module (fleet). Onclick button it will open an iframe.

My question is How to create a qWeb  view and integrate my Iframe in it.  

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

This can be done by adding an Iframe code in a standard view of type form like below as the docs says:

QWeb views are standard QWeb templates inside a view's arch. They don't have a specific root element. (Source)
<record model="ir.ui.view" id="your_view_id">
<field name="name">YourViewName</field>
<field name="model">fleet.vehicle</field>
<field name="arch" type="xml">
<iframe src="http://your-iframe-url.com" marginheight="0" marginwidth="0" frameborder="0" width="100%" height="750"/>
</field>
</record>

After that you have to create an action that opens that view and a button that calls that actions like below:

<record model="ir.actions.act_window" id="your_vehicle_tracking_action">
<field name="name">Tracking map</field>
<field name="res_model">fleet.vehicle</field>
<field name="view_mode">form</field>
<field name="view_id" ref="your_view.external_id"/>
</record>
<button name="%(your_module.your_vehicle_tracking_action)d" string="Track vehicle" type="action" class="oe_stat_button" icon="iconapp" help="Tack your vehicle"/>

Hope this helps !

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you for your help.

You are welcome !

Câu trả lời hay nhất

thank you, I can do it 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Abdelfateh ABDA, were you able to carry this out? I have to do something similar but don't need a button, just need the iframe be loaded with the target site after clicking on the menuitem entry. Thanks for your help

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 20
2818
3
thg 8 18
10486
5
thg 11 24
46791
1
thg 9 17
4610
3
thg 5 17
4801