Explorar el Código

[fix] get_valid_dict use default if none

version-14
Rushabh Mehta hace 8 años
padre
commit
8a87064541
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. +4
    -0
      frappe/model/base_document.py

+ 4
- 0
frappe/model/base_document.py Ver fichero

@@ -208,6 +208,10 @@ class BaseDocument(object):
if isinstance(d[fieldname], list) and df.fieldtype != 'Table':
frappe.throw(_('Value for {0} cannot be a list').format(_(df.label)))

# get the default value if none, for insert / update
if d[fieldname]==None and df.default:
d[fieldname] = df.default

return d

def init_valid_columns(self):


Cargando…
Cancelar
Guardar