Add asset barcode reprot
This commit is contained in:
parent
cac3e466c8
commit
254949e4d1
|
|
@ -33,6 +33,8 @@ Add asset operations (Transfer, Sell/Dispose, Maitenenace, Assesment)
|
|||
'data/asset_data.xml',
|
||||
'data/asset_cron.xml',
|
||||
'reports/reports.xml',
|
||||
'reports/asset_barcode_pdf_report.xml',
|
||||
'reports/asset_barcode_zpl_report.xml',
|
||||
'views/account_asset_view.xml',
|
||||
'views/account_asset_adjustment_view.xml',
|
||||
'views/menus.xml',
|
||||
|
|
|
|||
|
|
@ -890,3 +890,23 @@ msgstr "سجل تواصل الموقع"
|
|||
#, python-format
|
||||
msgid "You can not confirm operation without lines."
|
||||
msgstr "لا يمكن تأكيد العملية دون إدخال التفاصيل"
|
||||
|
||||
#. module: exp_asset_base
|
||||
#: model:ir.actions.report,name:exp_asset_base.label_barcode_account_asset
|
||||
msgid "Asset Barcode (ZPL)"
|
||||
msgstr "باركود الأصل (ZPL)"
|
||||
|
||||
#. module: exp_asset_base
|
||||
#: model:ir.actions.report,print_report_name:exp_asset_base.report_account_asset_barcode
|
||||
msgid "'Assets barcode - %s' % (object.name)"
|
||||
msgstr "'باركود الأصول - %s' % (object.name)"
|
||||
|
||||
#. module: exp_asset_base
|
||||
#: model:ir.actions.report,name:exp_asset_base.report_account_asset_barcode
|
||||
msgid "Asset Barcode (PDF)"
|
||||
msgstr "باركود الأصل (PDF)"
|
||||
|
||||
#. module: exp_asset_base
|
||||
#: model_terms:ir.ui.view,arch_db:exp_asset_base.report_asset_barcode
|
||||
msgid "<span class=\"text-muted\">No barcode available</span>"
|
||||
msgstr "لا يوجد باركود متاح"
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="report_asset_barcode">
|
||||
<div style="width: 32%; display: inline-table; height: 10rem;">
|
||||
<table class="table table-bordered mb-0" style="border: 2px solid black;">
|
||||
<tr>
|
||||
<th class="table-active text-left" style="height: 4rem;">
|
||||
<strong t-field="asset.display_name"/>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center align-middle" style="height: 6rem;">
|
||||
<t t-if="asset.barcode">
|
||||
<img alt="Barcode" t-if="len(asset.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', quote_plus(asset.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-elif="len(asset.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', quote_plus(asset.barcode or ''), 600, 150)" style="width:100%;height:4rem;"/>
|
||||
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', quote_plus(asset.barcode or ''), 600, 150)" style="width:100%;height:4rem"/>
|
||||
<span t-field="asset.barcode"/>
|
||||
</t>
|
||||
<t t-else=""><span class="text-muted">No barcode available</span></t>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="report_assetbarcode">
|
||||
<t t-call="web.basic_layout">
|
||||
<div class="page">
|
||||
<t t-foreach="docs" t-as="asset">
|
||||
<t t-call="exp_asset_base.report_asset_barcode">
|
||||
<t t-set="asset" t-value="asset"/>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<record id="report_account_asset_barcode" model="ir.actions.report">
|
||||
<field name="name">Asset Barcode (PDF)</field>
|
||||
<field name="model">account.asset</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">exp_asset_base.report_assetbarcode</field>
|
||||
<field name="report_file">exp_asset_base.report_assetbarcode</field>
|
||||
<field name="print_report_name">'Assets barcode - %s' % (object.name)</field>
|
||||
<field name="binding_model_id" ref="exp_asset_base.model_account_asset"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="label_barcode_account_asset_view">
|
||||
<t t-foreach="docs" t-as="asset">
|
||||
<t t-translation="off">
|
||||
^XA
|
||||
^FO100,50
|
||||
^A0N,44,33^FD<t t-esc="asset.display_name"/>^FS
|
||||
<t t-if="asset.barcode">
|
||||
^FO100,100^BY3
|
||||
^BCN,100,Y,N,N
|
||||
^FD<t t-esc="asset.barcode"/>^FS
|
||||
</t>
|
||||
^XZ
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
<record id="label_barcode_account_asset" model="ir.actions.report">
|
||||
<field name="name">Asset Barcode (ZPL)</field>
|
||||
<field name="model">account.asset</field>
|
||||
<field name="report_type">qweb-text</field>
|
||||
<field name="report_name">exp_asset_base.label_barcode_account_asset_view</field>
|
||||
<field name="report_file">exp_asset_base.label_barcode_account_asset_view</field>
|
||||
<field name="binding_model_id" ref="exp_asset_base.model_account_asset"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue