def set_default_if_missing(self): if self.doc.buying_or_selling=="Selling": if not webnotes.conn.get_value("Selling Settings", None, "selling_price_list"): webnotes.set_value("Selling Settings", "Selling Settings", "selling_price_list", self.doc.name) elif self.doc.buying_or_selling=="Buying": if not webnotes.conn.get_value("Buying Settings", None, "buying_price_list"): webnotes.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name)
def set_default_if_missing(self): if cint(self.doc.selling): if not webnotes.conn.get_value("Selling Settings", None, "selling_price_list"): webnotes.set_value("Selling Settings", "Selling Settings", "selling_price_list", self.doc.name) elif cint(self.doc.buying): if not webnotes.conn.get_value("Buying Settings", None, "buying_price_list"): webnotes.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name)
def make_bank_account(): ba = webnotes.bean({ "doctype": "Account", "account_name": bank_name, "account_type": "Bank or Cash", "group_or_ledger": "Ledger", "parent_account": "Bank Accounts - " + company_abbr, "company": company }).insert() webnotes.set_value("Company", company, "default_bank_account", ba.doc.name) webnotes.conn.commit()