Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6362 Lượt xem

Hi,


I am having issues inheriting a template in Odoo 15. Basically I am trying to inherit a template and as far as I am aware I am following the documentation correctly but when I update the module I am not seeing any of my changes, but I am also not receiving any errors.

My 'custom_search_panel.xml' file:



    
            

                

Test


            

    


My manifest file (removed fields like name, author, installable, etc for readability here):

'depends': ['web'],
'data': [
'security/ir.model.access.csv'
],
'assets': {
'web.assets_qweb': [
'custom_product_search_panel/static/src/xml/custom_search_panel.xml',
],
},


Any suggestions would be greatly appreciated. I was receiving errors when the XPATH wasn't working, but then once I fixed it I stopped getting errors but I can't see any of the changes to the template I make when I load up my module. For clarity too: I am doing this inheritance in an independent module and then installing it, as I am using the template I am inheriting in a view in another module and would like to change it. 

Ảnh đại diện
Huỷ bỏ
Tác giả

For some reason my xml did not show above so here is the XML in my file:

<?xml version="1.0" encoding="utf-8"?>

<templates xml:space="preserve">

<t t-inherit="web.SearchPanel" t-inherit-mode="extension">
<xpath expr="//div[@class='o_search_panel']" position="replace">
<div class="o_search_panel" t-att-class="env.searchModel.searchPanelInfo.className">
<b>Test</b>
</div>
</xpath>

</t>

</templates>

Hello, you are missing owl="1" in the XML file after the t-inherit-mode

Câu trả lời hay nhất

Please refer to the following code to achieve this

  

   

       

           

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi, thanks for the response but I can't see your code. Would you be able to send it again please?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 22
1813
2
thg 1 22
3163
2
thg 3 15
7139
2
thg 12 24
7887
1
thg 1 24
2335