Skip to Content
Menu
This question has been flagged
1 Odpoveď
1710 Zobrazenia

We need to print invoice on the continuous paper on the dot matrix. Anyone can suggest the add-on or configuration need.

Appreciate community support in advance.

Avatar
Zrušiť
Best Answer

Hi,


Follow the steps to create a new report for the Invoice (Dot matrix).

Firstly, you need to create a new paper format and report template for the report.

1- Paper format.

<record id="paperformat_dot_matrix_printer_invoice_reports" model="report.paperformat">
<field name="name">Dot-Matrix Report(Invoice)</field>
<field name="default" eval="True"/>
<field name="format">custom</field>
<field name="page_height">280</field>
<field name="page_width">242</field>
<field name="orientation">Portrait</field>
<field name="margin_top">30</field>
<field name="margin_bottom">27</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">43</field>
<field name="dpi">90</field>
<field name="disable_shrinking" eval="True"/>
</record>

This can be defined under the data file.

2- Add Report Template.

<template id="sale_invoice_report_dot_matrix">
<t t-call="web.html_container">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<t t-if="o.move_type in ['out_invoice','out_receipt'] and o.state == 'posted'">
<div class="page"
width="100%" style="font-family:'Lato';">
<br/>
<div class="layout text-center">
<h5 t-if="o.move_type in ['out_invoice','out_receipt'] and o.state == 'posted'"
style="text-align: center; margin-bottom:2px; font-size:22px;">
Sales Invoice
</h5>
</div>
#
#
#
# Table contents
#
#
#

</div>
</t>
</t>
</t>
</t>
</template>

3 - Add an action for printing the dot matrix report.


<record id="action_report_sale_invoice_dot_matrix" model="ir.actions.report">
<field name="name">Invoices (Dot Matrix)</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.sale_invoice_report_dot_matrix</field>
<field name="report_file">module_name.sale_invoice_report_dot_matrix</field>
<field name="binding_model_id" ref="account.model_account_move"/>
<field name="paperformat_id" ref="module_name.paperformat_dot_matrix_printer_invoice_reports"/>
<field name="binding_type">report</field>
</record>


This will create an action menu. You can design the report template by modifying the paper format settings.


If you want to edit the existing template, you need to make changes in the corresponding paper format as well as in the template.


Hope it helps.


Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
okt 25
241
1
okt 25
1698
2
okt 25
942
2
okt 25
636
1
sep 25
1771