From d1a64d89bea1d76b12d615bc622ee3ef7dd6e6db Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 11 May 2015 11:17:16 +0530 Subject: [PATCH] date issue fixed serial no --- erpnext/stock/doctype/serial_no/serial_no.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index e61678ca9b..59a0667c5c 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, cstr, flt, add_days, nowdate +from frappe.utils import cint, cstr, flt, add_days, nowdate, getdate from frappe import _, ValidationError from erpnext.controllers.stock_controller import StockController @@ -38,16 +38,16 @@ class SerialNo(StockController): if not self.warranty_expiry_date and not self.amc_expiry_date: self.maintenance_status = None - if self.warranty_expiry_date and self.warranty_expiry_date < nowdate(): + if self.warranty_expiry_date and getdate(self.warranty_expiry_date) < getdate(nowdate()): self.maintenance_status = "Out of Warranty" - if self.amc_expiry_date and self.amc_expiry_date < nowdate(): + if self.amc_expiry_date and getdate(self.amc_expiry_date) < getdate(nowdate()): self.maintenance_status = "Out of AMC" - if self.amc_expiry_date and self.amc_expiry_date >= nowdate(): + if self.amc_expiry_date and getdate(self.amc_expiry_date) >= getdate(nowdate()): self.maintenance_status = "Under AMC" - if self.warranty_expiry_date and self.warranty_expiry_date >= nowdate(): + if self.warranty_expiry_date and getdate(self.warranty_expiry_date) >= getdate(nowdate()): self.maintenance_status = "Under Warranty" def validate_warehouse(self):