Show user warning if "add item to custorder" fails
specifically, if user enters alpha chars for cost/price fields
This commit is contained in:
parent
f708cb0b25
commit
e308108bf7
|
@ -2124,6 +2124,8 @@
|
|||
|
||||
this.itemDialogSaving = false
|
||||
this.showingItemDialog = false
|
||||
}, response => {
|
||||
this.itemDialogSaving = false
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
|
@ -864,7 +864,10 @@ class CustomerOrderView(MasterView):
|
|||
|
||||
for field in ('unit_cost', 'regular_price_amount', 'case_size'):
|
||||
if field in pending_info:
|
||||
try:
|
||||
pending_info[field] = decimal.Decimal(pending_info[field])
|
||||
except decimal.InvalidOperation:
|
||||
return {'error': f"Invalid entry for field: {field}"}
|
||||
|
||||
pending_info['user'] = self.request.user
|
||||
|
||||
|
|
Loading…
Reference in a new issue