Skip to content

Commit

Permalink
[IMP] mrp_production_report: Change barcode with qr_code
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Jan 24, 2025
1 parent cae4baa commit db58bcc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
6 changes: 5 additions & 1 deletion mrp_production_report/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"author": "AvanzOSC,",
"license": "AGPL-3",
"summary": "BoM notes",
"depends": ["mrp", "mrp_workorder_sequence"],
"depends": [
"mrp",
"mrp_workorder_sequence",
"mrp_workorder_qr_code",
],
"data": ["report/mrp_production_report.xml"],
"installable": True,
}
24 changes: 21 additions & 3 deletions mrp_production_report/report/mrp_production_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,33 @@
<xpath expr="//table/tr[1]/th[1]" position="before">
<th width="15%" class="text-center"><strong>Sequence</strong></th>
</xpath>
<!-- Añadir qr en cada línea -->
<xpath expr="//table/tr[2]/td[1]" position="before">
<td width="15%" class="text-center">
<span t-field="line2.sequence" />
<div
t-field="line2.sequence"
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:100%;height:35px'}"
<t t-set="qr_code" t-value="line2._create_qr_code(line2.sequence)" />
<img
t-att-src="'data:image/png;base64,' + qr_code"
width="100px"
height="100px"
/>
</td>
</xpath>
<!-- Añadir QR del nombre -->
<xpath expr="//span[@t-field='o.name']/../.." position="after">
<t t-set="qr_code" t-value="o._create_qr_code(o.name)" />
<div style="position: absolute; top: -1px; left: 700px;">
<img
t-att-src="'data:image/png;base64,' + qr_code"
width="100px"
height="100px"
/>
</div>
</xpath>
<!-- Quitar código de barras -->
<xpath expr="//div[@t-field='o.name']/.." position="attributes">
<attribute name="t-if">False</attribute>
</xpath>
</template>

<template
Expand Down

0 comments on commit db58bcc

Please sign in to comment.