Skip to content

Commit

Permalink
Merge b98a0e6 into f7d9615
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Nov 22, 2019
2 parents f7d9615 + b98a0e6 commit 52d3f83
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions base_gs1_barcode/models/gs1_barcode.py
Expand Up @@ -83,9 +83,15 @@ def normalize_date(datestring):
return fields.Date.to_string(date)

# Prefix and Group Separator
# Search if the barcode contains the \x1D group separator already,
# and then use it. Some scanners are able to pass this group separator,
# and others are not able. If a user works with both devices,
# this is becomes the most effective mechanism to ensure co-existence.
if '\x1D' in barcode_string:
separator = '\x1D'
else:
separator = self.env.user.gs1_barcode_separator or '\x1D'
prefix = self.env.user.gs1_barcode_prefix or ''
separator = self.env.user.gs1_barcode_separator or '\x1D'

if not barcode_string.startswith(prefix):
raise exceptions.ValidationError(
_('Could not decode barcode : wrong prefix - the code should '
Expand Down

0 comments on commit 52d3f83

Please sign in to comment.