Skip to Content
Menu
This question has been flagged

I want to edit navbar and footer of the template "website_hr_recruitment.apply". To do this I've done the following (for footer only). But this is not showing any change. Help me to solve this.

web_module/views/templates.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="custom_application_form" name="Custom Application Form">
<t t-call="website_hr_recruitment.apply">
<t t-call="web_module.custom_footer"></t>
</t>
</template>

<!--Footer-->
<template id="custom_footer" name="Custom Footer">
<t t-call="website.footer_default">
<div id="footer">
<p>No footer</p>
</div>
</t>
</template>
</odoo>

web_module/controllers/controllers.py
from odoo import http

class FirstPage(http.Controller):
@http.route('/home/', auth='public', website=True, type='http')
def index(self, **kwargs):
return http.request.render('web_module.custom_application_form', {})
Avatar
Discard
Best Answer

Hi Mahmood,

Here is the bellow steps to inherit template:

1) First set website_hr_recruitment as depends on your custom module (in manifest)

2) now define one xml template file and you have to inherit template there

3) Now you can do like this:

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

<odoo>

    <data>

    <template id="template_apply_inherit" inherit_id="website_hr_recruitment.apply">

    <xpath expr="path_of_code_to_replace" position="replace">

        <!-- your custom code -->

    </xpath>

    </template>

    </data>

</odoo>


here you can do anything using xpath, if you want to learn more about xpath

https://goo.gl/zZzYw5 

To learn about how to inherit template in odoo

https://goo.gl/kv45LX

Don't forget to accept answer if it's helpful for you..

Thank you..


Avatar
Discard
Related Posts Replies Views Activity
0
Apr 21
846
1
Sep 20
1141
1
Sep 24
24093
1
Aug 16
9328
0
Jun 15
3877