mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
features by default on
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# REMEMBER to update this
|
# REMEMBER to update this
|
||||||
# ========================
|
# ========================
|
||||||
|
|
||||||
last_patch = 377
|
last_patch = 378
|
||||||
|
|
||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
|
|
||||||
@@ -423,3 +423,11 @@ def execute(patch_no):
|
|||||||
elif patch_no == 377:
|
elif patch_no == 377:
|
||||||
sql("delete from `tabDocField` where fieldname = 'item_searial_nos' and parent = 'Features Setup'")
|
sql("delete from `tabDocField` where fieldname = 'item_searial_nos' and parent = 'Features Setup'")
|
||||||
sql("delete from `tabDefaultValue` where defkey = 'item_searial_nos' and parent = 'Control Panel'")
|
sql("delete from `tabDefaultValue` where defkey = 'item_searial_nos' and parent = 'Control Panel'")
|
||||||
|
elif patch_no == 378:
|
||||||
|
rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null")
|
||||||
|
from webnotes.model.code import get_obj
|
||||||
|
m = get_obj('Features Setup')
|
||||||
|
for d in rs:
|
||||||
|
m.doc.fields[d[0]] = 1
|
||||||
|
m.doc.save()
|
||||||
|
m.validate()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class DocType:
|
|||||||
"""
|
"""
|
||||||
from webnotes.model import default_fields
|
from webnotes.model import default_fields
|
||||||
from webnotes.utils import set_default
|
from webnotes.utils import set_default
|
||||||
|
|
||||||
for key in self.doc.fields:
|
for key in self.doc.fields:
|
||||||
if key not in default_fields:
|
if key not in default_fields:
|
||||||
set_default(key, self.doc.fields[key])
|
set_default(key, self.doc.fields[key])
|
||||||
|
|||||||
Reference in New Issue
Block a user