From 1e335f3272ead746a7bb9f10e05a161a2c079289 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 1 May 2012 10:53:50 +0530 Subject: [PATCH] fixes in validattion of debit to account with customer in sales invoice --- .../accounts/doctype/receivable_voucher/receivable_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index 2d1db216b8..54ed7514a0 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -314,7 +314,7 @@ class DocType(TransactionBase): # ------------------------------------------------ def validate_debit_to_acc(self): if self.doc.customer and self.doc.debit_to and not cint(self.doc.is_pos): - acc_head = sql("select master_name from `tabAccount` where name = %s and docstatus != 2", self.doc.debit_to) + acc_head = webnotes.conn.sql("select master_name from `tabAccount` where name = %s and docstatus != 2", self.doc.debit_to) if (acc_head and cstr(acc_head[0][0]) != cstr(self.doc.customer)) or \ (not acc_head and (self.doc.debit_to != cstr(self.doc.customer) + " - " + self.get_company_abbr())):