<h1 class="title">Printer Escpos</h1>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/report-print-send/tree/13.0/printer_escpos"><img alt="OCA/report-print-send" src="https://img.shields.io/badge/github-OCA%2Freport--print--send-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/report-print-send-13-0/report-print-send-13-0-printer_escpos"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/144/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This modules allows to generate escpos tickets using XML</p>
<p>The idea was taken from <a class="reference external" href="https://github.com/fvdsn/py-xml-escpos">https://github.com/fvdsn/py-xml-escpos</a> but
it was rewritten in order to make it easier to manage (Licensed with MIT)</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id1">Installation</a></li>
<li><a class="reference internal" href="#usage" id="id2">Usage</a><ul>
<li><a class="reference internal" href="#format-of-the-ticket" id="id3">Format of the ticket</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<a name="installation"></a>
<h2><a class="toc-backref" href="#id1">Installation</a></h2>
<p>In order to make it work, you need to use python-escpos version 3.
You can get it on github</p>
<p><a class="reference external" href="https://github.com/python-escpos/python-escpos">https://github.com/python-escpos/python-escpos</a></p>
<a name="usage"></a>
<h2><a class="toc-backref" href="#id2">Usage</a></h2>
<p>To print a ticket, you need to call the ticket printing method.
It can be used anywhere (other modules, server actions, etc.).</p>
<p>Example : Print a ticket of a product</p>
<pre>
<code>self.env['printing.escpos'].browse(ticket_id).print_escpos(
self.env['printing.printer'].browse(printer_id),
self.env['product.product'].browse(product_id))</code>
</pre>
<p>You can also use the generic ticket printing wizard, if added on some models.</p>
<a name="format-of-the-ticket"></a>
<h3><a class="toc-backref" href="#id3">Format of the ticket</a></h3>
<p>The ESCPOS expects an XML with root tag receipt.
Inside we can use the following tags:</p>
<ul class="simple">
<li>p</li>
<li>div</li>
<li>section</li>
<li>article</li>
<li>receipt</li>
<li>header</li>
<li>footer</li>
<li>li</li>
<li>h1</li>
<li>h2</li>
<li>h3</li>
<li>h4</li>
<li>h5</li>
<li>line: Allows to manage lines. Each column must be right or left</li>
<li>ul: Bullet list</li>
<li>ol: Ordered list</li>
<li>pre</li>
<li>hr</li>
<li>br: Line break</li>
<li>qr: Inserts a QR. The text will be the value of the QR. With attribute qrsize we can make it bigger</li>
<li>img: Inserts an image</li>
<li>barcode: Inserts a barcode. Expects an attribute encoding in order to know which kind of barcode</li>
<li>cut</li>
<li>partialcut</li>
<li>cashdraw: Opens the cashdraw if configured</li>
</ul>
<p>At any tag we can add the following attributes in order to modify the style:</p>
<ul class="simple">
<li>align</li>
<li>underline: Can be on or off</li>
<li>bold: Can be on or off</li>
<li>size: Can be normal, double, double-height or double-weight</li>
<li>font: Can be A or B</li>
<li>width</li>
<li>indent</li>
<li>tabwidth</li>
<li>bullet: Describes the bullet description. By default ` - `</li>
<li>line-ratio</li>
<li>color</li>
</ul>
<a name="bug-tracker"></a>
<h2><a class="toc-backref" href="#id4">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/report-print-send/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/report-print-send/issues/new?body=module:%20printer_escpos%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
<a name="credits"></a>
<h2><a class="toc-backref" href="#id5">Credits</a></h2>
<a name="authors"></a>
<h3><a class="toc-backref" href="#id6">Authors</a></h3>
<ul class="simple">
<li>CreuBlanca</li>
</ul>
<a name="contributors"></a>
<h3><a class="toc-backref" href="#id7">Contributors</a></h3>
<ul class="simple">
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
</ul>
<a name="maintainers"></a>
<h3><a class="toc-backref" href="#id8">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/report-print-send/tree/13.0/printer_escpos">OCA/report-print-send</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>