Merge pull request #2091 from nabinhait/hotfix

Minor fixes
This commit is contained in:
Anand Doshi 2014-08-21 12:42:40 +05:30
commit bb3f192b07
2 changed files with 4 additions and 1 deletions

View File

@ -200,7 +200,7 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
def get_project_name(doctype, txt, searchfield, start, page_len, filters):
cond = ''
if filters['customer']:
if filters.get('customer'):
cond = '(`tabProject`.customer = "' + filters['customer'] + '" or ifnull(`tabProject`.customer,"")="") and'
return frappe.db.sql("""select `tabProject`.name from `tabProject`

View File

@ -194,6 +194,9 @@ class MaintenanceSchedule(TransactionBase):
sr_details = frappe.db.get_value("Serial No", serial_no,
["warranty_expiry_date", "amc_expiry_date", "status", "delivery_date"], as_dict=1)
if not sr_details:
frappe.throw(_("Serial No {0} not found").format(serial_no))
if sr_details.warranty_expiry_date and sr_details.warranty_expiry_date>=amc_start_date:
throw(_("Serial No {0} is under warranty upto {1}").format(serial_no, sr_details.warranty_expiry_date))