From 00260870d1ae8d42ceb90f9220c18e5b678cb040 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Mar 2012 12:50:55 +0530 Subject: [PATCH] fixes in rv --- .../doctype/receivable_voucher/receivable_voucher.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index a3412dd515..446a116c99 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -106,8 +106,8 @@ class DocType(TransactionBase): def get_debit_to(self): acc_head = self.get_customer_account() - if acc_head: - return { 'debit_to' : acc_head } + return acc_head and {'debit_to' : acc_head} or {} + # Set Due Date = Posting Date + Credit Days @@ -146,8 +146,7 @@ class DocType(TransactionBase): self.get_income_account('entries') ret = self.get_debit_to() - if ret.has_key('debit_to'): - self.doc.debit_to = ret['debit_to'] + self.doc.debit_to = ret.get('debit_to') # onload pull income account # --------------------------