콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
3214 화면

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
1913
0
6월 24
2119
1
10월 24
2876
0
5월 22
2805
2
8월 16
5802