Add initial "scanning" feature for Ordering Batches
This commit is contained in:
parent
801c56f06e
commit
329e75ee82
6 changed files with 553 additions and 32 deletions
|
@ -31,7 +31,6 @@ import logging
|
|||
import six
|
||||
import humanize
|
||||
|
||||
from rattail import pod
|
||||
from rattail.db import model
|
||||
from rattail.time import make_utc
|
||||
from rattail.util import pretty_quantity
|
||||
|
@ -268,9 +267,12 @@ class ReceivingBatchRowViews(APIBatchRowView):
|
|||
return filters
|
||||
|
||||
def normalize(self, row):
|
||||
batch = row.batch
|
||||
data = super(ReceivingBatchRowViews, self).normalize(row)
|
||||
|
||||
batch = row.batch
|
||||
app = self.get_rattail_app()
|
||||
prodder = app.get_products_handler()
|
||||
|
||||
data['product_uuid'] = row.product_uuid
|
||||
data['item_id'] = row.item_id
|
||||
data['upc'] = six.text_type(row.upc)
|
||||
|
@ -282,7 +284,7 @@ class ReceivingBatchRowViews(APIBatchRowView):
|
|||
|
||||
# only provide image url if so configured
|
||||
if self.rattail_config.getbool('rattail.batch', 'purchase.mobile_images', default=True):
|
||||
data['image_url'] = pod.get_image_url(self.rattail_config, row.upc) if row.upc else None
|
||||
data['image_url'] = prodder.get_image_url(product=row.product, upc=row.upc)
|
||||
|
||||
# unit_uom can vary by product
|
||||
data['unit_uom'] = 'LB' if row.product and row.product.weighed else 'EA'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue