Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Can I hide products on the website if they aren't on the currently selected or assigned pricelist?

Avatar
odoo
Avatar
Discard
1 Answer
0
Avatar
odoo
Best Answer

Make a custom view that overrides how the default view works:

Thee lines in BOLD UNDERLINE are what were added, these are the magic pieces!


<td t-att-colspan="td_product['x'] != 1 and td_product['x']" position="replace">
<t t-set="combination_info" t-value="product._get_combination_info(only_template=True, add_qty=add_qty or 1, pricelist=pricelist)"/>
<t t-if="combination_info['price'] and combination_info['price'] > 0">
<td t-att-colspan="td_product['x'] != 1 and td_product['x']"
t-att-rowspan="td_product['y'] != 1 and td_product['y']"
t-attf-class="oe_product #{td_product['class']}">
<div t-attf-class="o_wsale_product_grid_wrapper o_wsale_product_grid_wrapper_#{td_product['x']}_#{td_product['y']}">
<t t-call="website_sale.products_item">
<t t-set="product_image_big" t-value="td_product['x'] + td_product['y'] &gt; 2"/>
</t>
</div>
</td>
</t>
</td>


Then you get this:






Avatar
Discard