2020-03-14 18:33:08 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
2020-02-28 18:12:16 -06:00
|
|
|
"""
|
|
|
|
Product views
|
|
|
|
"""
|
|
|
|
|
|
|
|
from tailbone.views import products as base
|
2020-03-14 19:50:35 -05:00
|
|
|
from tailbone_corepos.views import products as corepos_base
|
2020-02-28 18:12:16 -06:00
|
|
|
|
|
|
|
|
2020-03-14 19:50:35 -05:00
|
|
|
class ProductView(corepos_base.ProductView):
|
2020-02-28 18:12:16 -06:00
|
|
|
"""
|
|
|
|
Product overrides for online demo
|
|
|
|
"""
|
|
|
|
|
|
|
|
def configure_form(self, f):
|
2020-03-14 19:50:35 -05:00
|
|
|
super(ProductView, self).configure_form(f)
|
2020-02-28 18:12:16 -06:00
|
|
|
|
|
|
|
if self.editing:
|
|
|
|
f.fields = [
|
|
|
|
'upc',
|
|
|
|
'brand_uuid',
|
|
|
|
'description',
|
|
|
|
'unit_size',
|
|
|
|
'unit_of_measure',
|
|
|
|
'size',
|
|
|
|
'pack_size',
|
|
|
|
'default_pack',
|
|
|
|
'case_size',
|
|
|
|
'weighed',
|
|
|
|
'department_uuid',
|
|
|
|
'subdepartment_uuid',
|
|
|
|
'category_uuid',
|
|
|
|
'family_uuid',
|
|
|
|
'report_code_uuid',
|
|
|
|
'regular_price_amount',
|
|
|
|
'deposit_link_uuid',
|
|
|
|
'tax_uuid',
|
|
|
|
'tax1',
|
|
|
|
'tax2',
|
|
|
|
'tax3',
|
|
|
|
'organic',
|
|
|
|
'kosher',
|
|
|
|
'vegan',
|
|
|
|
'vegetarian',
|
|
|
|
'gluten_free',
|
|
|
|
'sugar_free',
|
|
|
|
'discountable',
|
|
|
|
'special_order',
|
|
|
|
'not_for_sale',
|
|
|
|
'ingredients',
|
|
|
|
'notes',
|
|
|
|
'status',
|
|
|
|
'discontinued',
|
|
|
|
'deleted',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def includeme(config):
|
|
|
|
|
|
|
|
config.add_route('products.autocomplete', '/products/autocomplete')
|
|
|
|
config.add_view(base.ProductsAutocomplete, route_name='products.autocomplete',
|
|
|
|
renderer='json', permission='products.list')
|
|
|
|
|
|
|
|
config.add_route('products.print_labels', '/products/labels')
|
|
|
|
config.add_view(base.print_labels, route_name='products.print_labels',
|
|
|
|
renderer='json', permission='products.print_labels')
|
|
|
|
|
2020-03-14 19:50:35 -05:00
|
|
|
ProductView.defaults(config)
|