CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I want to create a custom page to let user send the file to server.
After receiving the file, openerp will create records into the database base on the value in the file
what should I do?
If you want to import function, first clear which file extension are use for data like .CSV or .XLS.
anyways, you have to create a function and read the data from .CSV or .XLS file.
from xlrd import open_workbook
def import_data(self, cr, uid, ids, context=None):
temp_path = tempfile.gettempdir()
test_obj = self.pool.get('test.test')
xls_data = base64.decodestring(xls_file)
wb = open_workbook(temp_path+'/xsl_file.xls')
for sheet in wb.sheets():
for rownum in range(sheet.nrows):
if rownum == 0:
header_list = sheet.row_values(rownum)
Hope this will help you alot
About This Community
Odoo Training Center
|Asked: 1/16/15, 1:54 AM|
|Seen: 2605 times|
|Last updated: 4/30/15, 1:32 AM|