Fix usage of Product.unit_of_measure vs. Product.weighed.

This commit is contained in:
Lance Edgar 2015-04-11 03:33:01 -05:00
parent 8c5f03da8c
commit 7c2b406d0d
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@
<td class="brand">${cost.product.brand or ''}</td>
<td class="desc">${cost.product.description}</td>
<td class="size">${cost.product.size or ''}</td>
<td class="case-qty">${cost.case_size} ${rattail.enum.UNIT_OF_MEASURE.get(cost.product.unit_of_measure, '')}</td>
<td class="case-qty">${cost.case_size} ${"LB" if cost.product.weighed else "EA"}</td>
<td class="code">${cost.code or ''}</td>
<td class="preferred">${'X' if cost.preference == 1 else ''}</td>
% for i in range(14):

View file

@ -172,7 +172,7 @@ class InventoryWorksheet(View):
q = q.filter(model.Product.deleted == False)
q = q.filter(model.Product.subdepartment == subdepartment)
if self.request.params.get('weighted-only'):
q = q.filter(model.Product.unit_of_measure == enum.UNIT_OF_MEASURE_POUND)
q = q.filter(model.Product.weighed == True)
if self.request.params.get('exclude-not-for-sale'):
q = q.filter(model.Product.not_for_sale == False)
q = q.order_by(model.Brand.name, model.Product.description)