Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Import contacts avoiding duplicates

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
importcontacts
3 Replies
5690 Rodiniai
Portretas
Manuel Alverdi

Context

I have to import a large list of contacts. Data for each contact includes name, a national ID number (unique), email, etc.

When I use the import function, there is no way to detect which contacts already exist, so they are duplicated.

Question

Is there a way to detect if a contact is going to be duplicated so I can skip that one and go to the next one?

I know there is a "fuse" function, and I already use it. But this is "after the fact", and I want to avoid the creation of duplicate contatcs.

Thanks!

0
Portretas
Atmesti
Portretas
Fabio Tielen
Best Answer

I believe there is a helper module at OCA that give you the option to select a field as unique comparison so you don't need external ID. You could use contact name or email or VAT ID as example. 


Update: this is the OCA module you want to test: https://odoo-community.org/shop/base-import-match-643#attr=42



0
Portretas
Atmesti
Manuel Alverdi
Autorius

Brilliant

Portretas
Thuy Ngoc
Best Answer

Hi  Manuel,

You need programming knowledge to create unique constraints for the that fields of the res.partners model. E.g

class ResPartner:

_inherit='res.partner' 

_sql_constraints = [
('email_uniq', 'UNIQUE (email)', 'Email already exists')
]


0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi

Normal Export and import method:
For importing a contact record we do the exporting process, so in that case the exporting record contains an external id, so when we reimport the same record it not adding the duplicates based on that record. So depending on the external id, there are no duplicates occurring in the import process we haven't external id the record will be duplicated.

Using Script:

def import_inv(self):
   
buffer = tempfile.NamedTemporaryFile(delete=False, suffix=".xlsx")
   
buffer.write(binascii.a2b_base64(self.file))
   
buffer.seek(0)
    book = xlrd.open_workbook(
buffer.name)
    sheet = book.sheet_by_index(
0)
           
for row_no in range(sheet.nrows):
       
if row_no <= 0:
            fields =
map(lambda row: row.value.encode('utf-8'),
                        sheet.row(row_no))
       
else:
           
line = list(
               
map(lambda row: isinstance(row.value,
                                          bytes)
and row.value.encode(
                   
'utf-8') or str(row.value),
                    sheet.row(row_no)))
            partner_id = self.env[
'res.partner'].sudo().browse([line[0]])

           
if line and not partner_id:
                self.env[
'res.partner'].sudo().create({
                   
'id': line[0],
                   
'active': line[1] if line[1] else False,
                   
'type': line[2] if line[2] else False,
                    //you can
add values based on the excel sheet

                })
            elif
line and partnr_id:
          //
if the partner id already available we can write the the record details
          partnr_id.
write({
                   
'id': line[0],
                   
'active': line[1] if line[1] else False,
                   
'type': line[2] if line[2] else False,
                    //you can
add values based on the excel sheet

                })

Hope it helps

-3
Portretas
Atmesti
Manuel Alverdi
Autorius

Hi Cybrosys. Thanks for the answer, but it does not work for the case I describe.

Of course I can export the file first. I can even chech in excel, prior to importing, if the contacts are duplicates by checking the email or national id number. And then I can upload the contacts that are not going to create a duplicated contact. But this is not what I'm trying to do.

I want to upload the contact list and during the import process I want to check if a the contact is going to be duplicated.

The issue with the process you suggest is that I have to use the contact's ID, and the new contacts (contacts that I want to import) have no ID prior to import. I can't create it manually since some contacts have the name "client" and others have a generic national ID number used when it is not provided.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
update contact list language encountering issue
import contacts
Portretas
0
kov. 24
1937
Importation contacts dans Odoo V17
import contacts
Portretas
0
gruod. 23
2208
How do I know what field to import in to?
import contacts importing
Portretas
Portretas
1
saus. 24
2419
How do I import my contacts so they are placed within (linked to) the company for which they work? Solved
import contacts companies
Portretas
Portretas
Portretas
Portretas
Portretas
18
kov. 24
22135
Import contacts in Odoo14 Solved
import contacts v14
Portretas
Portretas
1
geg. 21
5159
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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