Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to import excel file in ODOO 9

Odoberať

Get notified when there's activity on this post

This question has been flagged
xls
2 Replies
15216 Zobrazenia
Avatar
sridhar

I developed a custom import option for update the one2many table, for example I have a binary field for selecting xls or csv, then I have one button for import, this function will need to reterive the csv or xls data to create one2many records. In this code .csv is working fine but can't import .xls file. How to import .xls file.

    def records_import(self, cr, uid, ids, context=None):
supplier_obj = self.pool.get('res.partner')
for price in self.browse(cr, uid, ids, context=context):
fileName, fileExtension = os.path.splitext(price.file_to_import_fname)
if fileExtension != '.csv':
raise osv.except_osv(_("Warning !"), _("Change the file type as CSV"))
price_file = unicode(base64.decodestring(price.import_payment), 'windows-1252', 'strict').split('\n')
line_count = 0
ss = len(price_file)
for line in price_file:
line_count += 1
if line_count > 1:
if line_count < ss -1:
line_contents = line.split(',')
if not line_contents:
break
Name = line_contents[0].strip()
Amount = line_contents[1].strip()
supplier_id = supplier_obj.search(cr, uid, [('name', '=', Name)])
if supplier_id == []:
supplier = {
'name':Name
}
new_supplier = supplier_obj.create(cr, uid, supplier)
else:
for supp in supplier_obj.browse(cr, uid, supplier_id):
new_supplier = supp.id
price_line_exist = self.pool.get('sample.lines').search(cr, uid, [('name', '=', new_supplier),('payment_id', '=', price.id),('amount', '=', Amount)])
if price_line_exist == []:
price_upload_dict = {
'name' : new_supplier,
'amount': Amount
}
self.pool.get('sample.lines').create(cr, uid, price_upload_dict)
self.write(cr, uid, price.id,{'upload':True},context=context)
return {}
1
Avatar
Zrušiť
Avatar
Axel Mendoza
Best Answer

You need to use a xls/xlsx library to allow you to read that files formats and better use xlrd that read both.

Install this package

https://pypi.python.org/pypi/xlrd


Here some examples:

https://github.com/python-excel/xlrd/tree/master/xlrd/examples

https://github.com/python-excel/tutorial/tree/master/students/xlrd

You need to know from where(rows and cols) you will read the data

1
Avatar
Zrušiť
Avatar
DOCCA OutSource IT Kft. TAX ID: 11962144-2-43
Best Answer

Hi Axel,

I am a beginner so can you help how I could install this library to our local v9 instance? Any howto link would do where I could learn installing libraries. 

Thanks in advance,

Peter

0
Avatar
Zrušiť
Axel Mendoza

Hi Péter Mikó

In python the most used install method of libraries is using pip that is used to install libraries from

https://pypi.python.org/pypi/

if the library does not install from pypi, then you need to check the library docs about how to install it. To install anything from pypi you could issue the command

pip install library_name

to install for example https://pypi.python.org/pypi/xlrd

pip install xlrd

there are a lot of resources out there of how to install libraries in python, also if you have an already running odoo v9 instance, you already had installed some libraries for that

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Is there a good guide to learn how to export some fields to a xls file (Excel)?
xls
Avatar
Avatar
1
mar 15
4448
How to use report_xls module in Odoo ?
xls xls_reports
Avatar
0
nov 17
3979
Get data of xls file loaded to a binary field as two dimensional list[SOLVED] Solved
xls odoo10
Avatar
Avatar
1
mar 17
18185
error at installing module "import_order_xls"
xls odoo8
Avatar
Avatar
3
feb 16
4519
How to Download xls file stored in Ir_attachment or open an xls file saved in local? Solved
download xls
Avatar
1
okt 15
7100
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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