0
votes

In odoo 8 the website is generated from Qweb templates. The webpages can also contain fields (say like in the 'Contact Us' form).

In the normal Odoo Form view it is easy to make a field invisible or readonly dynamically based on the user entry in some other field.

How can the similar thing be done in the Website view?

2

2 Answers

0
votes

You can use a t-if statement, wrapped around the field you want to hide. Something like:

<div t-if="o.company_id">
    <span t-field="o.company_id.partner_id.name">
</div>

In this example, the "name" field will be hidden if "company_id" is not set.

Here's a link to the QWeb reference.

0
votes

If you want to omit some fields on dynamic basis. You can use "t-if" in your template, When you print it QWEB.