Odoo Help

0

Not able to extend the ImportView template of base_import module.

By
Vicky
on 7/17/17, 8:14 AM 170 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?

0
Vicky
On 7/17/17, 9:43 AM

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. 

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: 7/17/17, 8:14 AM
Seen: 170 times
Last updated: 7/17/17, 9:44 AM