refactor: suggested changes

This commit is contained in:
Noah Jacob
2021-07-12 09:18:19 +05:30
parent a1a4e8d616
commit 449c58d809
2 changed files with 16 additions and 19 deletions

View File

@@ -57,16 +57,16 @@ class Supplier(TransactionBase):
self.payment_terms = ""
self.accounts = []
if not self.accounts and doc.accounts:
if doc.accounts:
for account in doc.accounts:
child = self.append('accounts')
child.company = account.company
child.account = account.account
self.save()
if not self.payment_terms and doc.payment_terms:
if doc.payment_terms:
self.payment_terms = doc.payment_terms
self.save()
def validate_internal_supplier(self):
internal_supplier = frappe.db.get_value("Supplier",