Initial commit: OCA Warehouse packages (12 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:06 +02:00
commit af1eea7692
627 changed files with 55555 additions and 0 deletions

View file

@ -0,0 +1 @@
from . import barcode_actions_report

View file

@ -0,0 +1,16 @@
from odoo import api, models
class ReportStockBarcodesBarcodeActions(models.Model):
_name = "report.stock_barcodes.report_barcode_actions"
_description = "Print barcodes from barcode actions"
@api.model
def _get_report_values(self, docids, data=None):
datas = self.env["stock.barcodes.action"].search_read(
[("id", "in", docids), ("barcode", "!=", False)],
["name", "barcode", "barcode_image"],
)
return {
"barcodes": datas,
}

View file

@ -0,0 +1,25 @@
<odoo>
<template id="report_barcode_actions">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<div class="row text-center mb-4">
<h1>Scan your actions and streamline your actions.</h1>
</div>
<div class="row">
<t t-foreach="barcodes" t-as="barcode">
<div class="col-4 text-center">
<h2 t-out="barcode['name']" />
<img
t-att-src="'data:image/png;base64,%s' % barcode['barcode_image'].decode('utf-8')"
width="100%"
height="160px"
/>
</div>
</t>
</div>
</div>
</t>
</t>
</template>
</odoo>

View file

@ -0,0 +1,28 @@
<odoo>
<record id="paperformat_barcode_actions" model="report.paperformat">
<field name="name">A4</field>
<field name="default" eval="True" />
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">30</field>
<field name="margin_bottom">5</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False" />
<field name="header_spacing">5</field>
<field name="dpi">90</field>
</record>
<record id="action_report_barcode_actions" model="ir.actions.report">
<field name="name">Barcodes (PDF)</field>
<field name="model">stock.barcodes.action</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">stock_barcodes.report_barcode_actions</field>
<field name="report_file">stock_barcodes.report_barcode_actions</field>
<field name="print_report_name">'Barcodes - %s' % (object.name)</field>
<field name="binding_type">report</field>
<field name="paperformat_id" ref="paperformat_barcode_actions" />
</record>
</odoo>