Hello,
I am trying to add existing division of Odoo product template in a new division. for that, I can do the "replace" of the whole division. and add my custom division.
for example, here is default Odoo template section with the div.
<section t-attf-class="container mt8 oe_website_sale" id="product_detail">
<div class="row" id="odoo_default_row">
</div>
</section>
and I wanted to add odoo_default_row div in my custom div element. like
<section t-attf-class="container mt8 oe_website_sale" id="product_detail">
<div id="my_custom_div">
<div class="row" id="odoo_default_row">
</div>
</div>
</section>
what is the best way to add existing division in the custom division despite using xpath replace?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
13091
Views
Hi
Try this
<template id="website_sale" inherit_id="website.id_template" name="Name for your template ">
<xpath expr="//div[@id='odoo_default_row']" position="replace">
<div id="my_custom_div">
<div class="row" id="odoo_default_row">
</div>
</div>
</xpath>
</template>
You can replace a default element with a custom element or you can add a custom element to an default element. If you want to add a default element to a custom element, then you have to replace the default element with an element, which contains your custom element and the default element.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Jul 23
|
1241 | ||
|
1
Jul 21
|
7461 | ||
|
1
Aug 24
|
318 | ||
|
1
Jun 24
|
3225 | ||
|
2
Feb 24
|
5294 |