コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
2865 ビュー

Hello everyone,


Is it possible to have an HTML view in my custom module, but not on the website?


Thank you in advance.

アバター
破棄
最善の回答






Listing

















RFID Date and Time






アバター
破棄
最善の回答

Hello odoo already have html field , in there u can add image, block, table. So i assume u mean a view to edit raw html code, in that way in your xml view if u have a html field  then u just need to put a widget="ace" or using widget="code"

アバター
破棄
著作者 最善の回答

Thank you, Cybrosys. Could you also provide information on how to include JavaScript and CSS files for the HTML view?

Thank you Durong for your response! 

アバター
破棄
最善の回答

Hi,


We can achieve this by creating a custom view that uses the ir.ui.view model and defining it as an HTML view. This view can then be rendered within the backend interface of Odoo.


For example, use the following code:


<odoo>
    <record id="view_custom_html" model="ir.ui.view">
<field name="name">custom.html.view</field>
<field name="model">custom.model</field>
        <field name="arch" type="html">
            <div>
                  <p>Custom HTML View</p>

            </div>
        </field>
    </record>
</odoo>


Hope it helps.


アバター
破棄
関連投稿 返信 ビュー 活動
1
5月 24
1576
0
6月 24
1812
1
10月 24
2275
0
5月 22
2602
2
8月 16
5416