← Back to team overview

openerp-community team mailing list archive

Re: POS code sprint


I tought Akretion wasn't interested by the POS module when it was
released in the v6... :-P
It's a great news by the way !

About the customer display, I implemented it for a customer. You can
find attached the class. It's a qwick and dirty implementation but it
worked on their Aures device (like this :
The link between the device and the computer was a serial connection. In
case of USB connection you could use a serial port simulator over USB.
It's not clean but my customer's thermal printed worked this way.

I attach also some very short doc I had found about the Concert protocol
too. Note that the next step in european SEPA normalisation will be an
harmonization of the credit card framework. However, I don't kown if
it's just about changing banks commercial practices or developing a
complete trans-european protocol for credit card readers.

I think I have also some doc about check printer if you need it...

My 2 cents.

Le 29/06/2014 23:38, Alexis de Lattre a écrit :
> Dear OpenERP community friends,
> Akretion France is organising a code sprint on POS for OpenERP/Odoo v8
> (i.e. trunk) from July 7th to July 10th in Lyon. This code sprint will
> have 2 goals :
> 1) add support for credit card readers, via the Concert protocol. We
> will have an Ingenico credit card reader to carry out the tests ; we
> already have the specs and some sandbox Python code.
> 2) add support for traditional 2x20 POS displays. We will test it with
> Samsung-Bixolon BCD-1100, but want to make it easy to add support for
> other POS displays in the future. For that one too, we already have the
> specs and some sandbox Python code.
> This was initially an internal code sprint at Akretion France, but we
> thought other people could be interested and join the effort. We will
> welcome all participants, both those who want to join us in our office
> near Lyon (35B rue Montgolfier, 69100 Villeurbanne :
> http://www.openstreetmap.org/?mlat=45.7720&mlon=4.8902#map=12/45.7720/4.8902&layers=N)
> or those who want to join us remotely. We will have all the needed
> hardware on site to work efficiently. Confirmed participants so far are
> Sébastien Beau, Sylvain Le Gal and me.
> All the modules written during this code sprint will be published on
> https://launchpad.net/openerp-pos (or it's github equivalent).
> Regards,

# -*- coding: utf-8 -*-

import serial
import time

class CustomerDisplayDevice():
    def __init__(self, devfile="/dev/ttyS0", baudrate=9600, bytesize=8, timeout=1):
        @param devfile  : Device file under dev filesystem
        @param baudrate : Baud rate for serial transmission
        @param bytesize : Serial buffer size
        @param timeout  : Read/Write timeout
        self.devfile  = devfile
        self.baudrate = baudrate
        self.bytesize = bytesize
        self.timeout  = timeout
    def open(self):
        """ Setup serial port and set is as escpos device """
        self.device = serial.Serial(port=self.devfile, baudrate=self.baudrate, bytesize=self.bytesize, parity=serial.PARITY_NONE,  stopbits=serial.STOPBITS_ONE, timeout=self.timeout, dsrdtr=True)
        if self.device is not None:
            print "Serial customer display enabled"
            print "Unable to open serial customer display on: %s" % self.devfile
    def _raw(self, msg):
        """ Send any command sent in raw format """
        except :

    def text(self, msg):
            msg = unicodedata.normalize('NFKD', unicode(msg)).encode('ascii', 'ignore')
        except :
    def command(self, msg):
        """ Send any command sent in raw format """

    def clear_display(self):
    def set_cursor_position(self, x, y):
        x = int(x)
        y = int(y)
        if x<1 or x>20:
            return False
        if y<1 or y>2:
            return False
        self.command('\x1F\x24'+ chr(x) + chr(y))

    def __del__(self):
        """ Close Serial interface """
        if self.device is not None:

    def complete_string(self, string, length):
        string = unicode(string)
        if len(string) > length:
            return string[:length]
        elif len(string) < length:
                string = string+' '
            return string
            return string

    def update_product_line(self, product_name, qty_str, price_unit_str):
        str_prod = customer_display.complete_string(product_name, 20 - len(qty_str) - 2 - len(price_unit_str))
        customer_display.text(qty_str + 'x' + str_prod + ' ' + price_unit_str)
com_port = 7

try : 
    customer_display = CustomerDisplayDevice(com_port)
    customer_display.text('OUVERTURE CAISSE')
except :
    logging.error('Exception in customer display device init.', exc_info=True)

customer_display.update_product_line("Baguette tradition", "5", "0.95")

Attachment: ConcertSample.zip
Description: Zip archive

Attachment: Fit044_Protocole connexion caisse_RevB.pdf
Description: Adobe PDF document