Purge things for legacy (jquery) mobile, and unused template themes
gosh it feels good to get rid of this stuff... fingers crossed that nothing was broken, but am thinking it's safe
This commit is contained in:
parent
fac00e6ecd
commit
708641a8f1
70 changed files with 196 additions and 4886 deletions
|
@ -51,12 +51,7 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
model_title = "Ordering Batch"
|
||||
model_title_plural = "Ordering Batches"
|
||||
index_title = "Ordering"
|
||||
mobile_creatable = True
|
||||
rows_editable = True
|
||||
mobile_rows_creatable = True
|
||||
mobile_rows_quickable = True
|
||||
mobile_rows_editable = True
|
||||
mobile_rows_deletable = True
|
||||
has_worksheet = True
|
||||
|
||||
labels = {
|
||||
|
@ -86,21 +81,6 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
'executed_by',
|
||||
]
|
||||
|
||||
mobile_form_fields = [
|
||||
'vendor',
|
||||
'department',
|
||||
'date_ordered',
|
||||
'po_number',
|
||||
'po_total',
|
||||
'created',
|
||||
'created_by',
|
||||
'notes',
|
||||
'status_code',
|
||||
'complete',
|
||||
'executed',
|
||||
'executed_by',
|
||||
]
|
||||
|
||||
row_labels = {
|
||||
'po_total_calculated': "PO Total",
|
||||
}
|
||||
|
@ -161,8 +141,8 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
if self.creating or not batch.executed or not batch.purchase:
|
||||
f.remove_field('purchase')
|
||||
|
||||
def get_batch_kwargs(self, batch, mobile=False):
|
||||
kwargs = super(OrderingBatchView, self).get_batch_kwargs(batch, mobile=mobile)
|
||||
def get_batch_kwargs(self, batch, **kwargs):
|
||||
kwargs = super(OrderingBatchView, self).get_batch_kwargs(batch, **kwargs)
|
||||
kwargs['ship_method'] = batch.ship_method
|
||||
kwargs['notes_to_vendor'] = batch.notes_to_vendor
|
||||
return kwargs
|
||||
|
@ -387,60 +367,6 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
'batch_po_total_display': '${:0,.2f}'.format(batch.po_total_calculated or batch.po_total or 0),
|
||||
}
|
||||
|
||||
def render_mobile_listitem(self, batch, i):
|
||||
return "({}) {} on {} for ${:0,.2f}".format(batch.id_str, batch.vendor,
|
||||
batch.date_ordered, batch.po_total or 0)
|
||||
|
||||
def mobile_create(self):
|
||||
"""
|
||||
Mobile view for creating a new ordering batch
|
||||
"""
|
||||
mode = self.batch_mode
|
||||
data = {'mode': mode}
|
||||
|
||||
vendor = None
|
||||
if self.request.method == 'POST' and self.request.POST.get('vendor'):
|
||||
vendor = self.Session.query(model.Vendor).get(self.request.POST['vendor'])
|
||||
if vendor:
|
||||
|
||||
# fetch first to avoid flush below
|
||||
store = self.rattail_config.get_store(self.Session())
|
||||
|
||||
batch = self.model_class()
|
||||
batch.mode = mode
|
||||
batch.vendor = vendor
|
||||
batch.store = store
|
||||
batch.buyer = self.request.user.employee
|
||||
batch.created_by = self.request.user
|
||||
batch.po_total = 0
|
||||
kwargs = self.get_batch_kwargs(batch, mobile=True)
|
||||
batch = self.handler.make_batch(self.Session(), **kwargs)
|
||||
if self.handler.should_populate(batch):
|
||||
self.handler.populate(batch)
|
||||
return self.redirect(self.request.route_url('mobile.ordering.view', uuid=batch.uuid))
|
||||
|
||||
data['index_title'] = self.get_index_title()
|
||||
data['index_url'] = self.get_index_url(mobile=True)
|
||||
data['mode_title'] = self.enum.PURCHASE_BATCH_MODE[mode].capitalize()
|
||||
|
||||
data['vendor_use_autocomplete'] = self.rattail_config.getbool(
|
||||
'rattail', 'vendor.use_autocomplete', default=True)
|
||||
if not data['vendor_use_autocomplete']:
|
||||
vendors = self.Session.query(model.Vendor)\
|
||||
.order_by(model.Vendor.name)
|
||||
options = [(tags.Option(vendor.name, vendor.uuid))
|
||||
for vendor in vendors]
|
||||
options.insert(0, tags.Option("(please choose)", ''))
|
||||
data['vendor_options'] = options
|
||||
|
||||
return self.render_to_response('create', data, mobile=True)
|
||||
|
||||
def configure_mobile_row_form(self, f):
|
||||
super(OrderingBatchView, self).configure_mobile_row_form(f)
|
||||
if self.editing:
|
||||
# TODO: probably should take `allow_cases` into account here...
|
||||
f.focus_spec = '[name="units_ordered"]'
|
||||
|
||||
def download_excel(self):
|
||||
"""
|
||||
Download ordering batch as Excel spreadsheet.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue