Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

How to import CSV with multiple lines (same ID)

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
modulecustomodoo8.0
1 Răspunde
8938 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Pawan
Cel mai bun răspuns

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
Imagine profil
Abandonează
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!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Custom Module Not Populating in Apps List Rezolvat
module custom
Imagine profil
Imagine profil
4
oct. 20
9940
Import data from CSV
module import data custom odoo8.0
Imagine profil
0
oct. 15
4200
How can I create a Popup Message? Rezolvat
modules custom odoo8.0
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
oct. 25
16382
For Odoo hosted version, how would I upload a custom module? Rezolvat
module upload custom
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
feb. 24
11535
importing custom module
module custom importing
Imagine profil
Imagine profil
1
nov. 23
3858
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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