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.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
2
thg 9 23
|
1907 | |||
|
1
thg 7 18
|
4977 | |||
|
0
thg 3 15
|
4522 | |||
|
1
thg 8 25
|
1224 | |||
|
0
thg 11 24
|
4799 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.