Skip to content

Instantly share code, notes, and snippets.

@simahawk
Created March 10, 2016 16:32
Show Gist options
  • Select an option

  • Save simahawk/8b7c0f13823ba399d5d8 to your computer and use it in GitHub Desktop.

Select an option

Save simahawk/8b7c0f13823ba399d5d8 to your computer and use it in GitHub Desktop.
Odoo website - qweb t-field display issue w/ empty field
<!--
here if you don't have a description you'll see "My description",
no matter if you can edit the page or not.
-->
<div t-field="main_object.description">My description</div>
<!--
my workaround ATM: render w/ `t-field` only if editable
-->
<t t-if="editable">
<div t-field="main_object.description">
No description for this page yet. You see this because you can edit this page.
</div>
</t>
<t t-if="not editable and main_object.description">
<div t-esc="main_object.description" />
</t>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment