Make sure count mode is preserved when making new inventory batch

i.e. even if only one count mode is allowed for the user
This commit is contained in:
Lance Edgar 2018-05-29 13:10:45 -05:00
parent 6c0f243655
commit a557ec614a

View file

@ -225,7 +225,8 @@ class InventoryBatchView(BatchMasterView):
f.set_enum('mode', modes)
f.set_label('mode', "Count Mode")
if len(modes) == 1:
f.set_readonly('mode')
f.set_widget('mode', forms.widgets.ReadonlyWidget())
f.set_default('mode', list(modes)[0])
# total_cost
if self.creating: