fix(#10): Corregir visualización de código de barras en etiquetas
- Cambiar sintaxis de generación de código de barras a widget de Odoo 18 - Usar t-field con t-options para renderizar correctamente - El código de barras ahora se muestra correctamente en el PDF
This commit is contained in:
parent
2ebd8cc50d
commit
3e296d3c2c
BIN
documents/logs/Etiquetas de Muestras (4).pdf
Normal file
BIN
documents/logs/Etiquetas de Muestras (4).pdf
Normal file
Binary file not shown.
|
@ -58,12 +58,16 @@
|
|||
|
||||
<!-- Código de barras -->
|
||||
<div style="text-align: center; margin-top: 3mm;">
|
||||
<t t-set="barcode_value" t-value="o.barcode or o.name"/>
|
||||
<t t-set="barcode_value" t-value="o.barcode if o.barcode else o.name"/>
|
||||
<t t-if="barcode_value">
|
||||
<img t-attf-src="/report/barcode/?barcode_type=Code128&value={{barcode_value}}&width=250&height=60&humanreadable=1"
|
||||
style="width: 250px; height: 60px;"/>
|
||||
<div style="text-align: center; font-size: 10px; margin-top: 2px;">
|
||||
<span t-esc="barcode_value"/>
|
||||
<!-- Usar sintaxis específica de Odoo para código de barras -->
|
||||
<span t-field="o.barcode"
|
||||
t-options="{'widget': 'barcode', 'type': 'Code128', 'width': 250, 'height': 60, 'humanreadable': 1}"
|
||||
style="display: block;"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div style="border: 1px solid #ccc; width: 250px; height: 60px; margin: 0 auto; display: flex; align-items: center; justify-content: center;">
|
||||
<span style="color: #666;">Sin código de barras</span>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user