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.
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
2
sept. 23
|
1886 | |||
|
1
juil. 18
|
4951 | |||
|
0
mars 15
|
4499 | |||
|
1
août 25
|
1186 | |||
|
0
nov. 24
|
4777 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.