Odoo Help

0

How to inherit a view with xpath and <record> tag?

By
Pascal Tremblay
on 10/7/15, 6:08 PM 1,118 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.

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

Axel Mendoza
on 10/8/15, 6:45 PM

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.

Pascal Tremblay
on 10/8/15, 7:30 PM
0

Pascal Tremblay

--Pascal Tremblay--
1637
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 10/8/15, 9:00 PM

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>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 10/7/15, 6:08 PM
Seen: 1118 times
Last updated: 10/8/15, 9:01 PM