Skip to Content
Menu
This question has been flagged
3 Replies
10019 Views

Hello gang,

I'm trying to insert a stylesheet into a view (ir.ui.view) with the <record> tag in a xml file.... Usually, I use the <template> tag to make it.

How could I make it with <record> instead of <template>?

<record id="assets_frontend_pt" model="ir.ui.view">

    <field name="name">Assets frontend - PT</field>

    <field name="model">ir.ui.view</field>

    <field name="inherit_id" ref="website.assets_frontend"/>

    <field name="arch" type="xml">

        <xpath expr="." position="inside">

            <link rel="stylesheet" href="/website_multi_lapagept/static/src/css/frontend_pt.css"/>

        </xpath>

    </field>

</record>


Thanks to help.

Avatar
Discard

why didn't work for you using the template tag? I know that there is a simple conversion between the template tag and the record arch for the view

Author

I want to use the « record » tag because I need to put a value in « website_id » and « key » field of the view. I'm trying to implement website_multi.

Author Best Answer

It seems that this code is exactly what we needed :


<record id="assets_frontend_pt" model="ir.ui.view">

    <field name="name">Assets frontend - PT</field>

    <field name="website_id" ref="default_website_pt" />

    <field name="key">assets.frontend</field>

    <field name="inherit_id" ref="website.assets_frontend"/>

    <field name="arch" type="xml">

    <xpath expr="." position="inside">

        <link rel="stylesheet" href="/website_multi_lapagept/static/src/css/frontend_pt.css"/>

    </xpath>

    </field>
</record>
Avatar
Discard
Related Posts Replies Views Activity
2
Nov 20
10281
2
May 22
9302
0
Feb 16
3042
0
Sep 15
3416
0
Mar 15
3530