data import tool - convert type based on fieldtype for int, check, currency and float
This commit is contained in:
parent
8d83d47a14
commit
bcea4fa484
1 changed files with 5 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import webnotes
|
|||
import webnotes.model.doc
|
||||
import webnotes.model.doctype
|
||||
from webnotes.model.doc import Document
|
||||
from webnotes.utils import cstr
|
||||
from webnotes.utils import cstr, cint, flt
|
||||
from webnotes.utils.datautils import UnicodeWriter
|
||||
|
||||
data_keys = webnotes._dict({
|
||||
|
|
@ -276,6 +276,10 @@ def check_record(d, parenttype):
|
|||
|
||||
if val and docfield.fieldtype=='Date':
|
||||
d[key] = parse_date(val)
|
||||
elif val and docfield.fieldtype in ["Int", "Check"]:
|
||||
d[key] = cint(val)
|
||||
elif val and docfield.fieldtype in ["Currency", "Float"]:
|
||||
d[key] = flt(val)
|
||||
|
||||
def getlink(doctype, name):
|
||||
return '<a href="#Form/%(doctype)s/%(name)s">%(name)s</a>' % locals()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue