From 7887ccb441fc5978e8538c07cc0b8815f9a9230b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 Dec 2014 14:34:14 +0530 Subject: [PATCH] Credit days fix --- erpnext/accounts/doctype/account/account.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 7195db8a94d..3874ac21467 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt, cstr, cint, getdate, add_days, formatdate +from frappe.utils import flt, cstr, cint, getdate from frappe import msgprint, throw, _ from frappe.model.document import Document @@ -176,15 +176,7 @@ class Account(Document): frappe.throw(_("Due Date cannot be before Posting Date")) elif credit_days is not None and diff > credit_days: - is_credit_controller = frappe.db.get_value("Accounts Settings", None, - "credit_controller") in frappe.user.get_roles() - - if is_credit_controller: - msgprint(_("Note: Due Date exceeds the allowed credit days by {0} day(s)").format( - diff - credit_days)) - else: - max_due_date = formatdate(add_days(posting_date, credit_days)) - frappe.throw(_("Due Date cannot be after {0}").format(max_due_date)) + msgprint(_("Note: Due Date exceeds the allowed credit days by {0} day(s)").format(diff - credit_days)) def validate_trash(self): """checks gl entries and if child exists"""