Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odgovori
2903 Prikazi

Hello everyone,


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


Thank you in advance.

Avatar
Opusti
Best Answer






Listing

















RFID Date and Time






Avatar
Opusti
Best Answer

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"

Avatar
Opusti
Avtor Best Answer

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! 

Avatar
Opusti
Best Answer

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.


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
maj 24
1613
0
jun. 24
1828
1
okt. 24
2316
0
maj 22
2641
2
avg. 16
5456