Technical mailing list archives

technical@mail.odoo.com

Browse archives

Avatar

t-jquery replace

by
computersetup4
- 09/10/2018 00:26:12
Hi, all,

I am using CE 11.0. In the web_settings-dashboard addon, there is a file called
/odoo/addons/web_settings_dashboard/static/src/xml/dashboard.xml

I am trying to replace  o_web_settings_dashboard and o_web_settings_dashboard_share.
Here is my solution in xml:

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
    <t t-extend="UserMenu">
        <t t-jquery="ul.dropdown-menu" t-operation="replace">
            <ul class="dropdown-menu" role="menu">
                <li class="divider"/>
                <li><a href="#" data-menu="settings">Preferences</a></li>
                <li><a href="#" data-menu="logout">Log out</a></li>
            </ul>
        </t>
    </t>
    <!--<t t-extend="AppSwitcher.Content">-->
        <!--<t t-jquery="div.o_application_switcher_footer" t-operation="replace">-->
            <!--<img src="" width="96px" />-->
        <!--</t>-->
    <!--</t>-->
    <t t-extend="DashboardMain">
        <t t-jquery=".o_web_settings_dashboard" t-operation="replace">
            <div class="container-fluid o_web_settings_dashboard">
                <div class="row">
                    <div class="o_web_settings_dashboard_enterprise"/>
                    <div class="col-md-3 col-sm-6 col-xs-12 o_web_settings_dashboard_col">
                        <div class="text-center o_web_settings_dashboard_invitations"></div>
                        <div class="text-center o_web_settings_dashboard_share"></div>


                    <t t-jquery=".o_web_settings_dashboard_share" t-operation="replace">
                        <div class="text-center o_web_settings_dashboard_share">
                                <div class="col-md-12">
                                    <a t-if="debug != true" class="oe_activate_debug_mode pull-right" href="?debug" >Activate the developer mode</a>
                                    <br t-if="debug != true"/>
                                    <a t-if="debug != 'assets'" class="oe_activate_debug_mode pull-right" href="?debug=assets" >Activate the developer mode (with assets)</a>
                                    <br t-if="debug != 'assets'"/>
                                    <a t-if="debug != false" class="oe_activate_debug_mode pull-right" href="/web" >Deactivate the developer mode</a>
                                </div>
                        </div>
                    
                    </t>
 
                </div>
                </div>
            </div>
        </t>
    </t>

    <t t-extend="mail.client_action">
      <t t-jquery=".o_mail_request_permission" t-operation="inner">
        Your permission is required to <a href="#"> enable desktop notifications</a>.
      </t>
    </t>

</templates>


The  <t t-jquery=".o_web_settings_dashboard" t-operation="replace"> sentence works. However,   <t t-jquery=".o_web_settings_dashboard_share" t-operation="replace"> does not work. Does t-jquery support two levels of replace command? Or, what is the correct way to write this xml file?


Thanks,

Tom




Follow-Ups