Skip to content

Instantly share code, notes, and snippets.

@herawais
Created June 6, 2021 14:21
Show Gist options
  • Save herawais/9dba65c4b46270c6604d85e01fbb5509 to your computer and use it in GitHub Desktop.
Save herawais/9dba65c4b46270c6604d85e01fbb5509 to your computer and use it in GitHub Desktop.
Odoo Template Inheritance
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- Products Search Bar autocomplete item -->
<t t-name="website_sale.productsSearchBar.autocomplete.custom" t-inherit="website_sale.productsSearchBar.autocomplete" t-inherit-mode="extension" owl="1">
<xpath expr="//b[hasclass('text-nowrap')]" t-operation="before">
<b class="text-nowrap">
custom code
</b>
</xpath>
</t>
</templates>
@RadjaCyb
Copy link

RadjaCyb commented May 6, 2022

does it work ?
I tried to use this code in a custom module. I created an xml file inside static/src/xml and i put this code in it ...but its not working , the custom code is not showing
maybe the way i declare it in manifest file was wrong ? I'm using odoo 14

@herawais
Copy link
Author

herawais commented May 7, 2022

I am not sure, if it is working or not. i also not sure, why i created this gist . sorry

@jackysupit
Copy link

All I wanna do is simply hiding the duplicate, and delete from the action drowndown menu in form mode. Yet it looks impossible until now, 3 days still searching for it. I hate this odoo framework 😢

@herawais
Copy link
Author

All I wanna do is simply hiding the duplicate, and delete from the action drowndown menu in form mode. Yet it looks impossible until now, 3 days still searching for it. I hate this odoo framework 😢

which odoo version you are using ?

@herawais
Copy link
Author

@jackysupit , maybe i can help you with that, if you share some more info

@jackysupit
Copy link

i'm sorry, apparently the problem is on me. I read so many answers in stackoverflow and odoo forum, nothing works. But after I read the official documentation, now it works. my bad. thank you.

@jeevan-smartltd
Copy link

i'm sorry, apparently the problem is on me. I read so many answers in stackoverflow and odoo forum, nothing works. But after I read the official documentation, now it works. my bad. thank you.

Hi,
could you please post the solution you found ?

thanks

@jackysupit
Copy link

hi i am sorry for the very late reply. we can hide the same action button using the index. if there are 2 buttons, then we should write 2 separated code to hide those 2 buttons. using regular xpath, just different index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment