Changeset - 084e65a32de3
[Not reviewed]
0 2 0
Lance Edgar (lance) - 3 years ago 2021-08-29 16:36:36
lance@edbob.org
Tweak some customization hooks for custorder batch handler
2 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rattail/batch/custorder.py
Show inline comments
 
@@ -42,6 +42,9 @@ class CustomerOrderBatchHandler(BatchHandler):
 
    """
 
    batch_model_class = model.CustomerOrderBatch
 

	
 
    def get_case_size_for_product(self, product):
 
        return product.case_size
 

	
 
    def refresh_row(self, row):
 
        if not row.product:
 
            if row.item_entry:
 
@@ -60,7 +63,7 @@ class CustomerOrderBatchHandler(BatchHandler):
 
        row.product_description = product.description
 
        row.product_size = product.size
 
        row.product_weighed = product.weighed
 
        row.case_quantity = product.case_size
 
        row.case_quantity = self.get_case_size_for_product(product)
 

	
 
        department = product.department
 
        row.department_number = department.number if department else None
rattail/batch/handlers.py
Show inline comments
 
@@ -557,7 +557,11 @@ class BatchHandler(object):
 
        if product:
 
            return product
 

	
 
        # prefer caller-provided key over configured key
 
        product_key = kwargs.get('product_key')
 
        if not product_key:
 
            product_key = self.config.product_key()
 

	
 
        if product_key == 'upc':
 

	
 
            if entry.isdigit():
0 comments (0 inline, 0 general)