Improve vendor validation for new receiving batch
This commit is contained in:
parent
777a7afd46
commit
ae1e9dba0f
2 changed files with 21 additions and 1 deletions
|
@ -405,6 +405,12 @@ class PurchasingBatchView(BatchMasterView):
|
|||
'vendor_contact',
|
||||
'status_code')
|
||||
|
||||
def valid_vendor_uuid(self, node, value):
|
||||
model = self.model
|
||||
vendor = self.Session.query(model.Vendor).get(value)
|
||||
if not vendor:
|
||||
raise colander.Invalid(node, "Invalid vendor selection")
|
||||
|
||||
def render_store(self, batch, field):
|
||||
store = batch.store
|
||||
if not store:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue