Patch to rename doctype indent
This commit is contained in:
parent
3a82dfd171
commit
bf166e487d
37
erpnext/patches/jan_mar_2012/rename_doctype_indent.py
Normal file
37
erpnext/patches/jan_mar_2012/rename_doctype_indent.py
Normal file
@ -0,0 +1,37 @@
|
||||
import webnotes
|
||||
def execute():
|
||||
"""
|
||||
* Create DocType Label
|
||||
* Reload Related DocTypes
|
||||
"""
|
||||
create_doctype_label()
|
||||
reload_related_doctype()
|
||||
|
||||
|
||||
def create_doctype_label():
|
||||
"""
|
||||
Creates a DocType Label Record for Indent
|
||||
"""
|
||||
res = webnotes.conn.sql("""\
|
||||
SELECT name FROM `tabDocType Label`
|
||||
WHERE name='Indent'
|
||||
""")
|
||||
if not(res and res[0] and res[0][0]):
|
||||
from webnotes.model.doc import Document
|
||||
doclabel = Document('DocType Label')
|
||||
doclabel.dt = 'Indent'
|
||||
doclabel.dt_label = 'Purchase Requisition'
|
||||
doclabel.save(1)
|
||||
|
||||
|
||||
def reload_related_doctype():
|
||||
"""
|
||||
Reload:
|
||||
* indent
|
||||
* purchase_order
|
||||
* po_detail
|
||||
"""
|
||||
from webnotes.modules.module_manager import reload_doc
|
||||
reload_doc('buying', 'doctype', 'indent')
|
||||
reload_doc('buying', 'doctype', 'purchase_order')
|
||||
reload_doc('buying', 'doctype', 'po_detail')
|
Loading…
x
Reference in New Issue
Block a user