Direct Print to Dot Matrix Printer
by Akhmad D. Sembiring [vitraining.com] https://vitraining.com$ 121.37
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Discuss (mail)
• Inventory Management (stock) • Purchase Management (purchase) |
Lines of code | 418 |
Technical Name |
vit_dotmatrix |
License | OPL-1 |
Website | https://vitraining.com |
Versions | 8.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 |
Introduction
- this is modul is used to print PO, SO, Picking, Invoice directly to dot matrix printer
- no special hardware needed
- using python flask based printer proxy script
- add printer_data field on account.invoice, sale.order, purchase.order, stock.picking
- printer template data from email.template named "Dot Matrix *"
- you can easily modify the template to adjust your printed documents

One of the biggest challange in implementing Odoo in some companies especially Indonesia which already have so many daily transactions (like thousands of invoices per day), is printing to Dot Matrix Printer!
Yes, it is common in Indonesia's big trading companies to use Dot Matrix printer to print PO, SO, Invoices, Picking List to efficiently print using continuous and carbonized forms so they can print 3-4 document at once. Printing PDF file to dot matrix printers that can take the whole day just to print :(

This can be a big issue in Odoo standard, because it uses PDF for every document printing. The print result is good when printed at deskjet/ laserjet printers, but when it comes to dotmatrix, the font is broken and almost unreadable. This is because the dot per inch is too small. We can set it up bigger, but it will take some more time to print to dot matrix printer. It is impractical when it comes to print like 5000 invoices daily!

The solution is to use a proxy printing techniques. We make a small web server application at the client computer that is connected to the printer. That small application listen at a specific HTTP port and ready to receive request from Odoo's web browser client. At server side, we add an add-on that will send the raw data to print to that local application via HTTP post. The raw data is automatically composed based on the document to print using template.
The result is: AMAZING! printing is now direct to dot matrix printer with it's super fast speed and perfect printing result!


Installation on Linux/Mac/Raspberry Pi
- install this addon on the Odoo database
- copy the proxy python script from the vit_dotmatrix folder /static/py-printer-linux.zip to you local computer
- unzip into any folder on your local computer where the printer is connected
- install the required Python modules: flask and flask-cors, you can use pip install -r requirements.txt command
- follow the INSTALL.TXT instruction on how to install and run the script
- you can then print Invoice, SO, PO directly to local dotmatrix printer
Installation on Windows with Python
- install this addon on the Odoo database
- copy the proxy python script from the vit_dotmatrix folder /static/py-printer-win.zip to you local computer
- unzip into any folder on your local computer where the printer is connected
- install python on your windows computer by downloading the executable from http://python.org
- install the required Python modules: flask and flask-cors, you can use pip install -r requirements.txt command
- install py32win from https://github.com/mhammond/pywin32/releases
- you can then print Invoice, SO, PO directly to local dotmatrix printer
Determining which printer to use
Edit the file /py-printer-win/printer.py. At line 1: change PRINTER_NAME value to the exact printer name detected on your local computer. You can find this name from Windows Printer Device Manager control panel.
For Linux/Mac/Raspi it uses the default printer as assinged by the LPR printer system.
Detailed technical information
Want to customize more and get the detailed technical information? How to modify the template, add more features on other Odoo object? We have a Udemy course for this particular topic.
Click here to go to the Udemy course now!
Contact and Support
Contact Us: info[at]vitraining.com
Facebook : www.facebook.com/trainingOdoo
YouTube: www.youtube.com/channel/UCfLiSpb5nKcurnRIZse8zgA
Web: shop.vitraining.com
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedThere are no ratings yet!
ISSUE NOT RESOVED for more than 1 month!!
PLEASE HELP US WITH THIS ERROR!! WE HAVE NO RESPONSE FROM DEVELOPER. If no solved within a week, we will ask for Odoo's intervention.
ISSUE NOT RESOVED
Hello, Any news with the reported issue? we contacted you by this channel and by email, but no response a the time.
Testing ERRORS Nr2
Hello, We just purchase the v11 module, and got this testing errors. Please could you help ups with the fix. Thank you ERROR2 ERROR server Failed to render template using values {'format_date': . at 0x7f67844aed90>, 'format_tz': . at 0x7f67844ae510>, 'format_amount': . at 0x7f67844ae0d0>, 'user': res.users(1,), 'ctx': {'type': 'in_invoice'}, 'object': account.invoice(7,)} Traceback (most recent call last): File "/home/odoo/src/odoo/addons/mail/models/mail_template.py", line 371, in render_template render_result = template.render(variables) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "", line 16, in top-level template code TypeError: 'bool' object is not subscriptable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 797, in process self._process_node(node) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 810, in _process_node self.process_python(node) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 601, in process_python unsafe_eval(code_obj, {'ref': self.get_id}, code_context) File "/home/odoo/src/odoo/addons/account/demo/account_invoice_demo.yml", line 112, in self.env['account.invoice'].browse(ref('demo_invoice_january_wages')).action_invoice_open() File "/home/odoo/src/user/vit_dotmatrix/model/models.py", line 27, in action_invoice_open self.generate_printer_data() File "/home/odoo/src/user/vit_dotmatrix/model/models.py", line 16, in generate_printer_data data = tpl.render_template(tpl.body_html, 'account.invoice', self.id, post_process=False) File "/home/odoo/src/odoo/addons/mail/models/mail_template.py", line 374, in render_template raise UserError(_("Failed to render template %r using values %r")% (template, variables)) odoo.exceptions.UserError: ("Failed to render template using values {'format_date': . at 0x7f67844aed90>, 'format_tz': . at 0x7f67844ae510>, 'format_amount': . at 0x7f67844ae0d0>, 'user': res.users(1,), 'ctx': {'type': 'in_invoice'}, 'object': account.invoice(7,)}", '') '''
Re: Testing ERRORS Nr2
hi , can we access your odoo server ? are you trying to validate vendor bill or customer invoice ? you may contact by email for faster support thanks
Testing ERRORS Nr1
Hello, We just purchase the v11 module, and got this testing errors. Please could you help ups with the fix. Thank you ''' ERROR 1 ERROR server Failed to load registry Traceback (most recent call last): File "/home/odoo/src/odoo/addons/mail/models/mail_template.py", line 371, in render_template render_result = template.render(variables) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "", line 16, in top-level template code TypeError: 'bool' object is not subscriptable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/modules/registry.py", line 85, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/odoo/src/odoo/odoo/modules/loading.py", line 380, in load_modules loaded_modules, update_module, models_to_check) File "/home/odoo/src/odoo/odoo/modules/loading.py", line 274, in load_marked_modules perform_checks=perform_checks, models_to_check=models_to_check File "/home/odoo/src/odoo/odoo/modules/loading.py", line 184, in load_module_graph _load_data(cr, module_name, idref, mode, kind='demo') File "/home/odoo/src/odoo/odoo/modules/loading.py", line 95, in _load_data tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report) File "/home/odoo/src/odoo/odoo/tools/convert.py", line 790, in convert_file convert_yaml_import(cr, module, fp, kind, idref, mode, noupdate, report) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 854, in yaml_import yaml_interpreter.process(yaml_string) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 797, in process self._process_node(node) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 810, in _process_node self.process_python(node) File "/home/odoo/src/odoo/odoo/tools/yaml_import.py", line 601, in process_python unsafe_eval(code_obj, {'ref': self.get_id}, code_context) File "/home/odoo/src/odoo/addons/account/demo/account_invoice_demo.yml", line 112, in self.env['account.invoice'].browse(ref('demo_invoice_january_wages')).action_invoice_open() File "/home/odoo/src/user/vit_dotmatrix/model/models.py", line 27, in action_invoice_open self.generate_printer_data() File "/home/odoo/src/user/vit_dotmatrix/model/models.py", line 16, in generate_printer_data data = tpl.render_template(tpl.body_html, 'account.invoice', self.id, post_process=False) File "/home/odoo/src/odoo/addons/mail/models/mail_template.py", line 374, in render_template raise UserError(_("Failed to render template %r using values %r")% (template, variables)) odoo.exceptions.UserError: ("Failed to render template using values {'format_date': . at 0x7f67844aed90>, 'format_tz': . at 0x7f67844ae510>, 'format_amount': . at 0x7f67844ae0d0>, 'user': res.users(1,), 'ctx': {'type': 'in_invoice'}, 'object': account.invoice(7,)}", '') '''
LINK NOT FOUND: https://apps.odoo.com/vit_dotmatrix/static/dotmatrix.zip
Please provide new link. LINK NOT FOUND: https://apps.odoo.com/vit_dotmatrix/static/dotmatrix.zip
The service provided is extremely poor. The module is still not working. I would like a refund.
version 11
hi all, for version 11 on python 3.x please re download the addon version 1.2
Proxy script Link
hi all the link is only available on your Local Odoo installation, not on apps.odoo.com
Hi ., Link for proxy script dosen't work and is there any video how to make this configuration for your module
V9 Version
Hi, i would like to know if this module is available for v9 and if its how can i purchase. Thanks in advance.
Is not working on Odoo 11
I had to make some changes in order to run the module on Odoo 11 CE. Still unable to see the TAB with the DOT printer data. Where do I create a template for the whole invoice?
Have any tried this module
This seems like the solution Id been looking for... can any share its experience on how reliable this module is for DOT Matrix printers? Also, the link for the script seems out of date...
link 404 error
This link https://apps.odoo.com/vit_dotmatrix/static/dotmatrix.zip