introducing model 3.0, refactored import module

This commit is contained in:
Rushabh Mehta
2012-11-23 17:53:43 +05:30
parent a44b66e47a
commit 78d4b49e62
105 changed files with 137 additions and 145 deletions

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
def execute():
import webnotes
from webnotes.model.doclist import DocList
DocList("Website Settings", "Website Settings").save()
from webnotes.model.wrapper import ModelWrapper
ModelWrapper("Website Settings", "Website Settings").save()

View File

@@ -21,7 +21,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.model import delete_doc
from webnotes.modules import reload_doc
from webnotes.modules.export_module import export_to_files
from webnotes.modules.export_file import export_to_files
sql = webnotes.conn.sql

View File

@@ -24,7 +24,7 @@ sql = webnotes.conn.sql
from webnotes.utils import cint, cstr
def create_proper_index():
from webnotes.modules.export_module import export_to_files
from webnotes.modules.export_file import export_to_files
dt_index_fields={
'Purchase Receipt Item': ['prevdoc_docname', 'item_code', 'warehouse', 'prevdoc_detail_docname'],

View File

@@ -67,13 +67,13 @@ def save_pages():
}
import webnotes
from webnotes.model.doclist import DocList
from webnotes.model.wrapper import ModelWrapper
import webnotes.modules.patch_handler
for dt in query_map:
for result in webnotes.conn.sql(query_map[dt], as_dict=1):
try:
DocList(dt, result['name'].encode('utf-8')).save()
ModelWrapper(dt, result['name'].encode('utf-8')).save()
except Exception, e:
webnotes.modules.patch_handler.log(unicode(e))

View File

@@ -0,0 +1,6 @@
import webnotes
def execute():
webnotes.conn.sql("""delete from `tabSearch Criteria` where name='Delivery Note Itemwise Pending To Bill'""")
from webnotes.modules import reload_doc
reload_doc("stock", "report", "delivered_items_to_be_billed")

View File

@@ -675,4 +675,8 @@ patch_list = [
'patch_module': 'patches.november_2012',
'patch_file': 'disable_cancelled_profiles',
},
]
{
'patch_module': 'patches.november_2012',
'patch_file': 'remove_old_unbilled_items_report',
},
]