From 3c1fee7c6e22f882a1c33c44fbbd1f6e848e720f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 8 Feb 2013 19:28:32 +0530 Subject: [PATCH] validate fiscal year reused from accounts.utils --- accounts/doctype/gl_entry/gl_entry.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/accounts/doctype/gl_entry/gl_entry.py b/accounts/doctype/gl_entry/gl_entry.py index 9d53994e25..2a0985b04d 100644 --- a/accounts/doctype/gl_entry/gl_entry.py +++ b/accounts/doctype/gl_entry/gl_entry.py @@ -66,11 +66,8 @@ class DocType: self.doc.cost_center = "" def validate_posting_date(self): - from accounts.utils import get_fiscal_year - fiscal_year = get_fiscal_year(self.doc.posting_date)[0] - - if fiscal_year != self.doc.fiscal_year: - msgprint(_("Posting date must be in the Selected Fiscal Year"), raise_exception=1) + from accounts.utils import validate_fiscal_year + validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") def check_credit_limit(self): master_type, master_name = webnotes.conn.get_value("Account",