refactor: Folio no validation
This commit is contained in:
parent
268df35d80
commit
9fffe254fc
@ -168,10 +168,12 @@ class ShareTransfer(Document):
|
||||
return 'Outside'
|
||||
|
||||
def folio_no_validation(self):
|
||||
shareholders = ['from_shareholder', 'to_shareholder']
|
||||
shareholders = [shareholder for shareholder in shareholders if self.get(shareholder) is not '']
|
||||
for shareholder in shareholders:
|
||||
doc = self.get_shareholder_doc(self.get(shareholder))
|
||||
shareholder_fields = ['from_shareholder', 'to_shareholder']
|
||||
for shareholder_field in shareholder_fields:
|
||||
shareholder_name = self.get(shareholder_field)
|
||||
if not shareholder_name:
|
||||
continue
|
||||
doc = self.get_shareholder_doc(shareholder_name)
|
||||
if doc.company != self.company:
|
||||
frappe.throw(_('The shareholder does not belong to this company'))
|
||||
if not doc.folio_no:
|
||||
|
Loading…
x
Reference in New Issue
Block a user