Skip to content

Commit

Permalink
Add pick/pack info to all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdietrichc2c committed May 1, 2017
1 parent e94a77e commit 96a050a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions delivery_carrier_label_batch/wizard/generate_labels.py
Expand Up @@ -99,13 +99,12 @@ def _do_generate_labels(self, pack, picking, label):
package_ids=package_ids
)
except Exception as e:
if isinstance(e, exceptions.UserError):
# add information on picking and pack in the exception
picking_name = _('Picking: %s') % picking.name
pack_num = _('Pack: %s') % pack.name if pack else ''
raise exceptions.UserError(
('%s %s - %s') % (picking_name, pack_num, e.message)
)
# add information on picking and pack in the exception
picking_name = _('Picking: %s') % picking.name
pack_num = _('Pack: %s') % pack.name if pack else ''
raise exceptions.UserError(
('%s %s - %s') % (picking_name, pack_num, e)
)

def _worker(self, data_queue, error_queue):
""" A worker to generate labels
Expand Down

0 comments on commit 96a050a

Please sign in to comment.