diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 9e161e42bd1..1dd15bf5f9a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -994,7 +994,7 @@ class SalesInvoice(SellingController): return pos def get_company_abbr(self): - return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0] + return frappe.db.get_value("Company", self.company, "abbr") def validate_debit_to_acc(self): if not self.debit_to: