Refactor mobile receiving to use "quick row" feature

plus some other random things thrown in there, for good measure..
This commit is contained in:
Lance Edgar 2018-07-16 20:40:29 -05:00
parent 3cc8adba86
commit a34a42d2b2
9 changed files with 177 additions and 156 deletions

View file

@ -50,6 +50,10 @@ class PurchasingBatchView(BatchMasterView):
supports_new_product = False
cloneable = True
labels = {
'po_total': "PO Total",
}
grid_columns = [
'id',
'vendor',
@ -214,6 +218,16 @@ class PurchasingBatchView(BatchMasterView):
# form = super(PurchasingBatchView, self).make_form(batch, **kwargs)
# return form
def configure_common_form(self, f):
super(PurchasingBatchView, self).configure_common_form(f)
# po_total
if self.creating:
f.remove_field('po_total')
else:
f.set_readonly('po_total')
f.set_type('po_total', 'currency')
def configure_form(self, f):
super(PurchasingBatchView, self).configure_form(f)
batch = f.model_instance
@ -329,11 +343,6 @@ class PurchasingBatchView(BatchMasterView):
# po_number
f.set_label('po_number', "PO Number")
# po_total
f.set_readonly('po_total')
f.set_type('po_total', 'currency')
f.set_label('po_total', "PO Total")
# invoice_total
f.set_readonly('invoice_total')
f.set_type('invoice_total', 'currency')
@ -364,12 +373,6 @@ class PurchasingBatchView(BatchMasterView):
'vendor_contact',
'status_code')
def configure_mobile_form(self, f):
super(PurchasingBatchView, self).configure_mobile_form(f)
# currency fields
f.set_type('po_total', 'currency')
def render_store(self, batch, field):
store = batch.store
if not store: