Prevent mobile receiving actions for batch which is complete or executed

This commit is contained in:
Lance Edgar 2017-07-11 10:45:05 -05:00
parent af0eea76e2
commit 72b2510681
3 changed files with 88 additions and 74 deletions

View file

@ -6,8 +6,10 @@
${form.render()|n} ${form.render()|n}
<br /> <br />
% if not instance.executed and not instance.complete:
${h.text('upc-search', class_='receiving-upc-search', placeholder="Enter UPC", autocomplete='off', **{'data-type': 'search', 'data-url': url('mobile.receiving.lookup', uuid=batch.uuid)})} ${h.text('upc-search', class_='receiving-upc-search', placeholder="Enter UPC", autocomplete='off', **{'data-type': 'search', 'data-url': url('mobile.receiving.lookup', uuid=batch.uuid)})}
<br /> <br />
% endif
${grid.render_complete()|n} ${grid.render_complete()|n}

View file

@ -48,6 +48,7 @@
% endfor % endfor
% endif % endif
% if not instance.batch.executed and not instance.batch.complete:
<table id="receiving-quantity-keypad-thingy" data-changed="false"> <table id="receiving-quantity-keypad-thingy" data-changed="false">
<tbody> <tbody>
<tr> <tr>
@ -125,3 +126,4 @@ ${h.hidden('expiration_date')}
</div> </div>
${h.end_form()} ${h.end_form()}
% endif

View file

@ -208,7 +208,17 @@ class ReceivingBatchView(PurchasingBatchView):
fs.configure(include=[ fs.configure(include=[
fs.vendor.with_renderer(fa.TextFieldRenderer), fs.vendor.with_renderer(fa.TextFieldRenderer),
fs.department.with_renderer(fa.TextFieldRenderer), fs.department.with_renderer(fa.TextFieldRenderer),
fs.complete,
fs.executed,
fs.executed_by,
]) ])
batch = fs.model
if not batch.executed:
del [fs.executed, fs.executed_by]
if not batch.complete:
del fs.complete
else:
del fs.complete
def get_mobile_row_data(self, batch): def get_mobile_row_data(self, batch):
return super(ReceivingBatchView, self).get_mobile_row_data(batch)\ return super(ReceivingBatchView, self).get_mobile_row_data(batch)\