Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to access custom module using t-if condition in xml odoo

By
supreeth
on 6/7/16, 1:21 AM 542 views

I have a custom module test and created pages called test_1, test_2, test_3.

I have inherited calendar view and wrote a condition in js like all the calendar changes should be reflected to test_1. And that is working fine.

Now i need to remove Day and Month button from test_1 page -> Calendar view.

So i am trying to write t-if condition. I dont have idea how to call model. i tried below code but it is not working.

<template>

    <tr t-extend="CalendarView.quick_create">
        <t t-if="widget.model=='test_1'">
            <t t-jquery=".form-group" t-operation="after">
                <div class="form-group">
                    <h3>Example - put fields here </h3>
                </div>
            </t>
        </t>
    </tr>


</template>


It is not working throws an TypeError: Cannot read property 'model' of undefined

How to access model in t-if condition?



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/7/16, 1:21 AM
Seen: 542 times
Last updated: 6/7/16, 1:31 AM