Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivoustarvikkeet
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Tutoriaalit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

Import csv file with related field other than id, external id, name

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
importcsvimporting data from excel file
4 Vastaukset
12667 Näkymät
Avatar
Gabriel Caceres Cabriza

Hello,

I have researched a lot in the forum and I can not find a way to be able to import a csv file with columns whose value is not the name, id and external id of a related field.

Example:
Model 1:

_inherit = "res.partner"

Field1 = fields.Char (string = "Example")


Model 2:

  _name = 'mymodel'

     Field1 = fields.Char (string = "This is an example field")
     Partner = fields.Many2one ('res.partner', string = "Supplier")

I can not find a way to import a column into the csv file and relate it to the "field 1" field in the partner model.

I appreciate any help you can give me with the case.

Thank you very much!

1
Avatar
Hylkää
Avatar
Niyas Raphy (Walnut Software Solutions)
Paras vastaus

Hi Gabriel,

What does it show while trying to import the CSV file ?

Make sure that the relation field , ie, the field partner in the CSV of  'mymodel' hold the id of the res.partner.

You can refer this doc it will give you some more information .

Thank You



1
Avatar
Hylkää
Avatar
J.A. Daniel Göppner
Paras vastaus

Hi Gabriel


If you have a lot of such imports coming from other systems where you have always had to use a mapping, search for ID/ IDs, use ETL, transform data, clead before import, import with context, import in models and child models, conditional import [import if value or expression is true] etc,.. And also use python methods

I can recommend this powerful tool which is also used for mass importing or even a data connector [CSV, TXT, Excel]

https://braintec.com/r/Pip


With this module, the users can:

- Import data for several related models at the same time from a single file.

- Import data on batches, or select different delimiters or columns. Or define conditions to skip some lines or inactive records.

- Import data based on any field to compare existing records.

- Decide to import data based in another related model records.

- What actions this data needs to perform in the Database.

- Code a few lines in the import to transform the data or add new data before inserting it if needed. Or check that related records already exist in the database to allow the import of the line.

0
Avatar
Hylkää
Avatar
XOLUTO
Paras vastaus

For example when importing "res.partner" from an excel with related fields for state_id (Provence or county), title  you can do it like that => 

Just build a record for your vals_list and do a lookup for the related fields

insert_record = {

...

"is_company": True,              

"title": self.env['res.partner.title'].search( domain=[('name', '=', rec.anrede.strip())],                            limit=1).id,                        "name": rec.name.strip(),                        "street": 

rec.adresse.strip(),                        

"zip": rec.plz.strip(),                        

"city": rec.ort.strip(),         

 "state_id": self.env['res.country.state'].search(domain=[('code', '=', rec.bundesland.strip())],                            limit=1).id                    

}

0
Avatar
Hylkää
Avatar
Gabriel Caceres Cabriza
Tekijä Paras vastaus

The problem is that I do not have the partner id in the csv file (it is a report that generates another system). I only have the field data "field1" and I want to relate this to the related field for the partner in the csv to import. I do not have the id, external id or the name.

Many thanks in advance for the answer Niyas!

0
Avatar
Hylkää
Niyas Raphy (Walnut Software Solutions)

Hi,

Then just add a new column into the csv file reprsenting the field , and give the corresponding values into it.

Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
Differ context on test import and real import Ratkaistu
import csv importing data from excel file odoo11
Avatar
1
tammik. 25
6276
Disable automatic follow when importing res.partner csv
import csv
Avatar
Avatar
Avatar
3
kesäk. 20
4850
Enable/disable import rights?
import csv
Avatar
Avatar
1
marrask. 18
10333
'utf8' codec can't decode byte error when importing a list of products as a CSV file Ratkaistu
import csv
Avatar
Avatar
Avatar
Avatar
Avatar
11
helmik. 17
64859
Import contacts through CSV Ratkaistu
import csv
Avatar
Avatar
2
maalisk. 15
11937
Yhteisö
  • Tutoriaalit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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