From 6e3b00be68d28b8b64bba40397fd2554e1b34171 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 19 Aug 2019 21:55:47 +0530 Subject: [PATCH] fix(postgres): Convert check value to int everytime Since posgres does not internally coerces boolean to int (Note: mysql does) --- frappe/model/base_document.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index 570835bc32..df34ea491d 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -210,11 +210,7 @@ class BaseDocument(object): df = self.meta.get_field(fieldname) if df: if df.fieldtype=="Check": - if d[fieldname]==None: - d[fieldname] = 0 - - elif (not isinstance(d[fieldname], int) or d[fieldname] > 1): - d[fieldname] = 1 if cint(d[fieldname]) else 0 + d[fieldname] = 1 if cint(d[fieldname]) else 0 elif df.fieldtype=="Int" and not isinstance(d[fieldname], int): d[fieldname] = cint(d[fieldname])