Various tweaks for mobile receiving batches
this is temporary, soon will refactor all that again..
This commit is contained in:
parent
5cb3f15616
commit
d93b91f491
4 changed files with 29 additions and 11 deletions
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2016 Lance Edgar
|
||||
# Copyright © 2010-2017 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -80,6 +80,7 @@ class PurchaseBatchView(BatchMasterView):
|
|||
rows_creatable = True
|
||||
rows_editable = True
|
||||
edit_with_rows = False
|
||||
supports_mobile = True
|
||||
|
||||
order_form_header_columns = [
|
||||
"UPC",
|
||||
|
@ -915,9 +916,16 @@ class PurchaseBatchView(BatchMasterView):
|
|||
result['image_url'] = pod.get_image_url(self.rattail_config, upc)
|
||||
return result
|
||||
|
||||
def mobile_index(self):
|
||||
self.mobile = True
|
||||
return self.render_to_response('mobile_index', {})
|
||||
def mobile_menu(self):
|
||||
"""
|
||||
Mobile menu page for purchasing/receiving batches
|
||||
"""
|
||||
return self.render_to_response('menu', {}, mobile=True)
|
||||
|
||||
def get_mobile_data(self, session=None):
|
||||
# TODO: for now, only show receiving batches..
|
||||
return self.get_data(session=session)\
|
||||
.filter(model.PurchaseBatch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING)
|
||||
|
||||
def mobile_create(self):
|
||||
"""
|
||||
|
@ -963,9 +971,9 @@ class PurchaseBatchView(BatchMasterView):
|
|||
model_key = cls.get_model_key()
|
||||
model_title = cls.get_model_title()
|
||||
|
||||
# mobile index
|
||||
config.add_route('{}.mobile'.format(route_prefix), '/mobile{}'.format(url_prefix))
|
||||
config.add_view(cls, attr='mobile_index', route_name='{}.mobile'.format(route_prefix),
|
||||
# mobile menu
|
||||
config.add_route('{}.mobile_menu'.format(route_prefix), '/mobile{}/menu'.format(url_prefix))
|
||||
config.add_view(cls, attr='mobile_menu', route_name='{}.mobile_menu'.format(route_prefix),
|
||||
permission='{}.list'.format(permission_prefix))
|
||||
|
||||
# mobile create
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue