Skip to content

Instantly share code, notes, and snippets.

@nhomar
Last active December 8, 2015 02:09
Show Gist options
  • Select an option

  • Save nhomar/ddaadf3e57b281b053ec to your computer and use it in GitHub Desktop.

Select an option

Save nhomar/ddaadf3e57b281b053ec to your computer and use it in GitHub Desktop.
logic
<template id="product_box" name="product">
<hi><t t-esc="title"/></h1>
<div>
<t t-set="counter" t-value=1/>
<t t-foreach="products" t-as="p">
<t t-call="product_detail_vertical"/>
</t>
</div>
</template>
<template id="product_detail_vertical">
<div t-attf-class="col-lg-2 col-md-3 col-sm-4 col-xs-6 #{'hiden-sm hiden-md' if counter > 3}"/> <!-- Here the logi to hide for md and sm.
</template>
<template id="home">
<t t-set="products" t-value="env['product.template'].mtodo_get(params)">
<t t-call="product_box"/>
<t t-set="products" t-value="env['product.template'].mtodo_get2(params)">
<t t-call="product_box"/>
<t t-set="products" t-value="env['product.template'].mtodo_get2(params)">
<t t-call="product_box"/>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment