跳至内容
菜单
此问题已终结
1 回复
10388 查看

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', {})
形象
丢弃
最佳答案

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..


形象
丢弃
相关帖文 回复 查看 活动
0
4月 21
1736
1
9月 20
1745
1
3月 25
25544
1
8月 16
10464
0
6月 15
4860