Skip to Content
Menu
This question has been flagged
1 Reply
4059 Views

I want to customise import view by extending the ImportView template of base_import module. 

I referred the template extending and also referred this  https://stackoverflow.com/questions/42075393/template-inheritance-of-the-client-side-in-odoo-10 link. But it didn't work for me. 


Below is my extending code:

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
  <template>
   <t t-name="ImportView" t-extend="ImportView">
       <t t-jquery=".oe_import_box" t-operation="after">
<!--- I tried jquery selector line as class="div.oe_import_box" also, but it din't work -->
     <div class=".oe_import_box col-sm-9">  
               <div class="col-sm-12">
                   <p>Select a CSV or Excel file to import from FTP. <a href="https://www.odoo.com/documentation/user/10.0/general/base_import/import_faq.html" target="new" class="pull-right">Help</a></p>
               </div>
              </div>
         </t>
     </t>
  </template>
 </data>
</odoo>

May be I am making mistake in writing the jquery selector path. Could someone help me regarding this?

Avatar
Discard
Author Best Answer

Finally, extended the ImportView. 

I created the new template file in static/src/xml directory and updated the code like:

<template>
 <t t-extend="ImportView">
     <t t-jquery=".oe_import_box" t-operation="after">
    <div class=".oe_import_box col-sm-9">
             <div class="col-sm-12">
                 <p>Select a CSV or Excel file to import. <a href="https://www.odoo.com/documentation/user/10.0/general/base_import/import_faq.html" target="new" class="pull-right">Help</a></p>
             </div>
</div>
</t>
</t>
</template>

and included the file in __manifest__.py file 

'qweb': ['static/src/xml/custom_base_import.xml'],

This worked well. 

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
18017
1
Sep 23
1202
3
May 23
4088
7
Apr 23
47087
1
Dec 22
6433