Odoo Help

Welcome!

This community 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.

0

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

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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