Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to import CSV with multiple lines (same ID)

Odebírat

Get notified when there's activity on this post

This question has been flagged
modulecustomodoo8.0
1 Odpovědět
8941 Zobrazení
Avatar
Dr Obx

Guys, how can I import data from CSV file but if for example some lines contains data related to the same "order number"? 

Picture below should explain everything.


Same customer, multiple items. I would like to combine it into one single record.

| 143306 | 18-Sep-2015 | 18-Sep-2015 | 250869522623 Full Height Matrox G550 PCI Card F7011-0001G55MDDAP32DB,
 260747082667 Matrox G200 MMS Quad Display Graphics Card 4 DVI fp, 261084913104 NVidia NVS285 PCI-E x16 New Shape 128MB Low Profile Card+Dual DVI Splitter Cable | .....

Or maybe every record should contain a table (many2one fields)?

Going that way I added a class:

class item_list(models.Model):
_name = 'item.list'
_description = "Item list in record"
nitem_id = fields.Many2one('item_id')
nitem_title = fields.Many2one('item_title')
nquantity = fields.Many2one('quantity')
item_log_id = fields.Many2one('item_list','Product')
and in main class I added
items_list = fields.One2many('item.list','item_log_id', string="Items ordered ⇒")

   Now loading a data from CSV and still got nothing not even one item is added :(


0
Avatar
Zrušit
Avatar
Pawan
Nejlepší odpověď

Dr Obx,

you can use the following format for your csv file to add the data if you are using systems default import functionality.

You don't need to give the order name again in every line, just change the product and quantity in every next line for same orders.:

Order Date,Order Reference,Supplier,Destination,Pricelist,Order Lines / Product,Order Lines / Quantity

2012-12-15,PO00008,ASUSTeK,Stock,Default Purchase Pricelist,ADPT,20

,,,,,CARD,30

,,,,,C-Case,40

2012-12-15,PO00009,Axelor,Stock,Default Purchase Pricelist,CD,5

,,,,,CPUa8,15

Hope this will help you

0
Avatar
Zrušit
Dr Obx
Autor

Hi Pawan, unfortunately I have no choice, CSV file comes from outside source so I prefer not to change anything (to be hones for me it doesn't matter but third person can have a problem with it) so better if it will as it is (CSV file). As we spoken earlier, I just importing ready (downloaded) CSV file without change option :)

Pawan

then you have to write a customized functionality for reading a csv file and import data from it for creating your orders...

Dr Obx
Autor

Should be data written into the table into class which inherits from parent class ?

Dr Obx
Autor

or is it there but need to be loaded into the table ?

Dr Obx
Autor

Studying examples ... still not found how to ...

Pawan

where are you stucked??

Dr Obx
Autor

It's difficult to say where i'm not stucked :) I just need one more time to do everything step by step with you i guess ;) First thing: I created a class order_lines and inside this class I have item_id, item_title, quantity, sale_price. However I found that is a very bad idea because a lot of other things require item_id for example. So once I update module getting a lot of errors :) However, sorted it out but still when I'm trying to load CSV it won't load anything into those fields. Also, getting errors like:

2015-09-23 09:38:13,562 4533 WARNING GNG openerp.fields: Field order.lines.item_order_line with unknown comodel_name 'iprodstep_log'
2015-09-23 09:38:13,562 4533 WARNING GNG openerp.fields: Field order.lines.item_title with unknown comodel_name 'iprodstep_log'
2015-09-23 09:38:13,562 4533 WARNING GNG openerp.fields: Field order.lines.item_id with unknown comodel_name 'iprodstep_log'
2015-09-23 09:38:13,563 4533 WARNING GNG openerp.fields: Field order.lines.sale_price with unknown comodel_name 'iprodstep_log'
2015-09-23 09:38:13,563 4533 WARNING GNG openerp.fields: Field order.lines.sales_record_number with unknown comodel_name 'iprodstep_log'
2015-09-23 09:38:13,800 4533 WARNING GNG openerp.fields: Field product.line.state with unknown comodel_name 'iprodstep_log'
I know why, baceuse in this class 'order_lines' I should create a fields like: item_id = fields.Char() but I tried with item_id = fields.Many2one(). So once I add:
#----------------- Order lines ----------------
class order_lines(models.Model):
	_name = 'order.lines'
	_description = 'Order lines'
	
	item_order_line = fields.Many2one('iprodstep_log','Item')
	item_id = fields.Char()
	item_title = fields.Char()
	quantity = fields.Integer()
	sale_price = fields.Char()

	
#----------------- Main class -----------------    
class iprodstep_log(models.Model):
	_name = 'iprodstep.log'
	_description = 'iprodstep log'
	_inherit = ['ir.needaction_mixin','order.lines']

#------------------ Sub table -----------------
	order_line = fields.One2many('order.lines','item_order_line',string='item lines')

#--------- Sub table related fields -----------
	item_id = fields.Char('Item Number')
	item_title = fields.Char('Item Title')
	quantity = fields.Integer('Quantity')
	sale_price = fields.Char('Sale price')

I have a table but how can i write some data from one class to another ? Tried using write:
			record.write({'order_lines.item_id': 'item_id'})
2015-09-23 11:29:03,314 6987 WARNING GNG openerp.models: iprodstep.log.write() with unknown fields: order_lines.item_id
Dr Obx
Autor

New week, new, ideas, new challenges ! Any thoughts how to solve this issue ??

Pawan

New week, new ideas, new challenges, and new solution.... new problem.... ;)

Pawan

anyway, please provide a brief what has been done till now in that....

Dr Obx
Autor

Hi Pawan, been busy last week, so I had no time to try. This week I will buid custom import module and I hope it will work :):)

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Custom Module Not Populating in Apps List Vyřešeno
module custom
Avatar
Avatar
4
říj 20
9940
Import data from CSV
module import data custom odoo8.0
Avatar
0
říj 15
4200
How can I create a Popup Message? Vyřešeno
modules custom odoo8.0
Avatar
Avatar
Avatar
Avatar
Avatar
4
říj 25
16382
For Odoo hosted version, how would I upload a custom module? Vyřešeno
module upload custom
Avatar
Avatar
Avatar
Avatar
3
úno 24
11535
importing custom module
module custom importing
Avatar
Avatar
1
lis 23
3858
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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