Hi;
how to create button and method to import Excel file?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Xml
<button name="import_xls" string="Import" type="object" />
Py
import base64
import xlrd
xls_file = fields.Binary('File')
def import_xls(self):
wb = xlrd.open_workbook(file_contents=base64.decodestring(self.xls_file))
for sheet in wb.sheets():
for row in range(sheet.nrows):
for col in range(sheet.ncols):
print (sheet.cell(row,col).value)
If helpful you , upvote this.
Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!
Регистрация| Похожие посты | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
2
сент. 23
|
1944 | |||
|
1
июл. 18
|
5006 | |||
|
0
мар. 15
|
4560 | |||
|
1
авг. 25
|
1295 | |||
|
0
нояб. 24
|
4856 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.