Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

Hello everyone, sorry for the inconvenience, is it possible to import a password-protected Excel file into Odoo?

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
urgent
1 Trả lời
2241 Lượt xem
Ảnh đại diện
BEKOIN ETIENNE

Hello everyone, sorry for the inconvenience, is it possible to import a password-protected Excel file into Odoo?

0
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Bhushan vagh
Câu trả lời hay nhất

No it is not possible but you can use online password removal after that you can import that file
or 
Open the password-protected Excel file in Excel or another spreadsheet application. and copy to another one

3
Ảnh đại diện
Huỷ bỏ
BEKOIN ETIENNE
Tác giả

ah ok thanks but my problem is that I can receive more than 100 files per day and if I want to copy to another file it can slow down the work

Bhushan vagh

in that case just write script where you can encrypt password and update it
just like
def Remove_password_xlsx(filename, pw_str):
xcl = win32com.client.Dispatch("Excel.Application")
wb = xcl.Workbooks.Open(filename, False, False, None, pw_str)
xcl.DisplayAlerts = False
wb.SaveAs(filename, None, '', '')
xcl.Quit()

after that you can do your desired outcome

BEKOIN ETIENNE
Tác giả

here is my code help me adapt it

from io import BytesIO

from odoo import api, fields, models, _
from odoo.exceptions import UserError
import openpyxl
import base64

#
#
# class ExcelImportWizard(models.TransientModel):
# _name = 'excel.import.wizard'
#
# excel_file = fields.Binary(string='Excel File', required=True)
# password = fields.Char(string='Password', default='IPACRCI', required=True)
#
#
# def import_excel_data(self):
# # Vérifier si un fichier Excel est téléchargé
# if not self.excel_file:
# raise UserError(_("Please upload an Excel file."))
#
# # Ouvrir le fichier Excel avec le mot de passe fourni
# excel_data = None
# try:
# excel_workbook = openpyxl.load_workbook(filename=False, data=self.excel_file, read_only=True,
# keep_links=False, pa

class ExcelImportWizard(models.TransientModel):
_name = 'excel.import.wizard'

excel_file = fields.Binary(string='Excel File', required=True)
password = fields.Char(string='Password', default='IPACRCI')

def import_excel_data(self):

if not self.excel_file:
raise UserError(_("Please upload an Excel file."))

try:

file_content = base64.b64decode(self.excel_file)
excel_workbook = openpyxl.load_workbook(filename=BytesIO(file_content), read_only=True, keep_links=False,
password=self.password)
excel_sheet = excel_workbook.active
excel_data = excel_sheet.iter_rows(values_only=True)
except Exception as e:
raise UserError(("Failed to open Excel file: %s" % e))

for row in excel_data:
self.env['excel.imported.data'].create({
'field1': row[0],
'field2': row[1],

})

raise UserError(_("Excel data imported successfully."))

class ExcelImportedData(models.Model):
_name = 'excel.imported.data'
_description = 'Excel Imported Data'

field1 = fields.Char(string='Field 1')
field2 = fields.Char(string='Field 2')

Bhushan vagh

import pandas as pd
from openpyxl import load_workbook

# Open the password-protected file
password = 'your_password'
file_path = 'path/to/password_protected_file.xlsx'
wb = load_workbook(filename=file_path, read_only=False, keep_vba=True)

add this
wb.security.workbookPassword = password
wb.save(file_path)

# Now read the unlocked file
df = pd.read_excel(file_path)

# Process the data and import it into Odoo

BEKOIN ETIENNE
Tác giả

Really thank you for your help and sorry for the inconvenience, but how to do to download the file since I have a file download interface where I introduce in my old code? THANK YOU AGAIN FOR THE TIME YOU GIVE ME

Bhushan vagh

step 1:-
pip install msoffcrypto
step 2 :-
from odoo import models, fields, _
from odoo.exceptions import UserError
import base64
from io import BytesIO
import openpyxl
import msoffcrypto

class ExcelImportWizard(models.TransientModel):
_name = 'excel.import.wizard'

excel_file = fields.Binary(string='Excel File', required=True)
password = fields.Char(string='Password', default='IPACRCI')

def import_excel_data(self):
if not self.excel_file:
raise UserError(_("Please upload an Excel file."))

try:
file_content = base64.b64decode(self.excel_file)
decrypted_file = BytesIO()
office_file = msoffcrypto.OfficeFile(BytesIO(file_content))
office_file.load_key(password=self.password)
office_file.decrypt(decrypted_file)
decrypted_file.seek(0)

excel_workbook = openpyxl.load_workbook(filename=decrypted_file, read_only=True, keep_links=False)
excel_sheet = excel_workbook.active
excel_data = excel_sheet.iter_rows(values_only=True)
except Exception as e:
raise UserError(_("Failed to open Excel file: %s" % e))

for row in excel_data:
self.env['excel.imported.data'].create({
'field1': row[0],
'field2': row[1],
})

raise UserError(_("Excel data imported successfully."))

class ExcelImportedData(models.Model):
_name = 'excel.imported.data'
_description = 'Excel Imported Data'

field1 = fields.Char(string='Field 1')
field2 = fields.Char(string='Field 2')

Thanks
Feel free to connect :
Email: bhushanwagh292@gmail.com
LinkedIn: https://in.linkedin.com/in/bhushan-wagh-09a161160
Happy to help :)

Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

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
install odoo17
urgent
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 11 25
3050
equivalence in odoo 17 :<field name="struct_id" attrs="{'required':[('farmer','=',True)]}"/> Đã xử lý
urgent
Ảnh đại diện
Ảnh đại diện
1
thg 6 24
4155
code equivalence
urgent
Ảnh đại diện
Ảnh đại diện
1
thg 6 24
2145
install odoo17 enterprise version Đã xử lý
urgent
Ảnh đại diện
Ảnh đại diện
2
thg 6 24
5619
Hello odoo community please how to install odoo 17 on a VPS running on an ubuntu 20.04 system Đã xử lý
urgent
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 6 24
3339
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now