More tweaks to support mobile inventory batches
This commit is contained in:
parent
8a5dbc33a7
commit
1791bd745b
4 changed files with 24 additions and 11 deletions
|
@ -395,6 +395,11 @@ class BatchMasterView(MasterView):
|
|||
|
||||
return self.render_to_response('edit', context)
|
||||
|
||||
def mobile_mark_complete(self):
|
||||
batch = self.get_instance()
|
||||
batch.complete = True
|
||||
return self.redirect(self.get_index_url(mobile=True))
|
||||
|
||||
def rows_creatable_for(self, batch):
|
||||
"""
|
||||
Only allow creating new rows on a batch if it hasn't yet been executed.
|
||||
|
@ -992,6 +997,7 @@ class BatchMasterView(MasterView):
|
|||
|
||||
@classmethod
|
||||
def _batch_defaults(cls, config):
|
||||
model_key = cls.get_model_key()
|
||||
route_prefix = cls.get_route_prefix()
|
||||
url_prefix = cls.get_url_prefix()
|
||||
permission_prefix = cls.get_permission_prefix()
|
||||
|
@ -1022,6 +1028,12 @@ class BatchMasterView(MasterView):
|
|||
config.add_tailbone_permission(permission_prefix, '{}.delete_rows'.format(permission_prefix),
|
||||
"Bulk-delete data rows from {}".format(model_title))
|
||||
|
||||
# mobile mark complete
|
||||
config.add_route('mobile.{}.mark_complete'.format(route_prefix), '/mobile{}/{{{}}}/mark-complete'.format(url_prefix, model_key))
|
||||
config.add_view(cls, attr='mobile_mark_complete', route_name='mobile.{}.mark_complete'.format(route_prefix),
|
||||
permission='{}.edit'.format(permission_prefix))
|
||||
|
||||
|
||||
# execute batch
|
||||
config.add_route('{}.execute'.format(route_prefix), '{}/{{uuid}}/execute'.format(url_prefix))
|
||||
config.add_view(cls, attr='execute', route_name='{}.execute'.format(route_prefix),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue