mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 18:21:22 +00:00
fixes in stock reconciliation and price list csv reading
This commit is contained in:
@@ -52,9 +52,9 @@ class DocType:
|
||||
|
||||
# update prices in Price List
|
||||
def update_prices(self):
|
||||
from core.page.data_import_tool.data_import_tool import read_csv_content
|
||||
from webnotes.utils.datautils import read_csv_content_from_attached_file
|
||||
data = read_csv_content_from_attached_file(self.doc)
|
||||
|
||||
data = read_csv_content(self.get_csv_data())
|
||||
webnotes.conn.auto_commit_on_many_writes = 1
|
||||
|
||||
updated = 0
|
||||
@@ -85,21 +85,4 @@ class DocType:
|
||||
msgprint("[Ignored] Did not find Item '%s'" % line[1])
|
||||
|
||||
msgprint("<b>%s</b> items updated" % updated)
|
||||
webnotes.conn.auto_commit_on_many_writes = 0
|
||||
|
||||
# Update CSV data
|
||||
def get_csv_data(self):
|
||||
if not self.doc.file_list:
|
||||
msgprint("File not attached!")
|
||||
raise Exception
|
||||
|
||||
fid = self.doc.file_list.split(',')[1]
|
||||
|
||||
try:
|
||||
from webnotes.utils import file_manager
|
||||
fn, content = file_manager.get_file(fid)
|
||||
except Exception, e:
|
||||
webnotes.msgprint("Unable to open attached file. Please try again.")
|
||||
raise e
|
||||
|
||||
return content
|
||||
webnotes.conn.auto_commit_on_many_writes = 0
|
||||
Reference in New Issue
Block a user