Hi,
I have a function field with this code (trytond 7.0, python-barcode 0.15.1):
try:
from trytond.tools import barcode
except ImportError:
barcode = None
def get_barcode_image(self, name=None):
if not barcode or not self.code:
return
image = barcode.generate_png('upc', self.code, width=2, height=80)
return image
It generate the code but sometimes doesn’t display the code correctly.
For example, with this code 033123223010 I got this image
Also I’m not sure why but tryton was printing the code correctly
But for this 272082554843 it works fine
After reading the first code doesn’t fit the EAN standard, so, it converts to the fit the standard but doesn’t work for us because the provider gives us 12 digits code.
How to display the code correctly?
Best.