[IMP] website_sale_aplicoop: render user-defined website_sale ribbon alongside stock ribbon
Eskaera shop cards now display the standard website_sale ribbon (variant_ribbon_id or website_ribbon_id, e.g. "Novedad") in addition to the dynamic stock ribbon. Stock ribbons move to the right so they coexist with user-defined ribbons (which default to the left). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
3b8cb7582b
commit
c8e0461120
2 changed files with 7 additions and 2 deletions
|
|
@ -4,9 +4,10 @@
|
|||
<odoo>
|
||||
<data noupdate="0">
|
||||
<!-- Ribbon: Out of Stock -->
|
||||
<!-- position=right so it doesn't collide with user-defined ribbons (e.g. Novedad), which default to left -->
|
||||
<record id="out_of_stock_ribbon" model="product.ribbon">
|
||||
<field name="name">Out of Stock</field>
|
||||
<field name="position">left</field>
|
||||
<field name="position">right</field>
|
||||
<field name="text_color">#FFFFFF</field>
|
||||
<field name="bg_color">#d9534f</field>
|
||||
</record>
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
<!-- Ribbon: Low Stock -->
|
||||
<record id="low_stock_ribbon" model="product.ribbon">
|
||||
<field name="name">Low Stock</field>
|
||||
<field name="position">left</field>
|
||||
<field name="position">right</field>
|
||||
<field name="text_color">#FFFFFF</field>
|
||||
<field name="bg_color">#ffc107</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -638,6 +638,10 @@
|
|||
<i class="fa fa-image fa-3x text-muted" />
|
||||
</div>
|
||||
</t>
|
||||
<t t-set="user_ribbon" t-value="product.sudo().variant_ribbon_id or product.sudo().website_ribbon_id" />
|
||||
<t t-if="user_ribbon">
|
||||
<span t-attf-class="o_ribbon {{ user_ribbon._get_position_class() }} z-1" t-attf-style="color: {{ user_ribbon.text_color }}; background-color: {{ user_ribbon.bg_color }};" t-esc="user_ribbon.name" />
|
||||
</t>
|
||||
<t t-if="product.dynamic_ribbon_id">
|
||||
<t t-set="ribbon" t-value="product.dynamic_ribbon_id" />
|
||||
<span t-attf-class="o_ribbon {{ ribbon._get_position_class() }} z-1" t-attf-style="color: {{ ribbon.text_color }}; background-color: {{ ribbon.bg_color }};" t-esc="ribbon.name" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue