Sfoglia il codice sorgente

Convert doc field value to string type before using (#5795)

version-14
Sushant Nadkar 7 anni fa
committed by Rushabh Mehta
parent
commit
f8dc45c3c1
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      frappe/model/naming.py

+ 2
- 2
frappe/model/naming.py Vedi File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now_datetime, cint
from frappe.utils import now_datetime, cint, cstr
import re
from six import string_types

@@ -258,7 +258,7 @@ def _field_autoname(autoname, doc, skip_slicing=None):
`autoname` field starts with 'field:'
"""
fieldname = autoname if skip_slicing else autoname[6:]
name = (doc.get(fieldname) or '').strip()
name = (cstr(doc.get(fieldname)) or '').strip()
return name




Caricamento…
Annulla
Salva