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.

1

how can I add my google analytic tracking code to an inherit module (depend on web)

By
phoebe
on 3/7/14, 6:05 AM 1,129 views

I want to get tracking information by using google analytic tracking code in OpenERP. I know the easiest way is just copy the tracking code into web module base.xml file (under class oe_view_manager_body). When I did that, the tracking function works well.

But I need to upgrade the source code timely, so I need to create a new module inherited web module and add that tracking code in to that new created module. So I would update web module a lot.

The problem is I can't get any signal if I put the tracking code into the new module. Could anyone help?

In my web_new, I have static/src/xml/custom.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="ViewManager">
    <t t-jquery="div.oe_view_manager_body" t-operation="replace">
        <div class="oe_view_manager_body">
        <script>
            Tracking_Code
        </script>
            <t t-foreach="widget.views_src" t-as="view">
                <div t-attf-class="oe_view_manager_view_#{view.view_type}"/>
            </t>
        </div>
    </t>
</t>
</templates>

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

0 follower(s)

Stats

Asked: 3/7/14, 6:05 AM
Seen: 1129 times
Last updated: 3/16/15, 8:10 AM