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
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    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

Import contacts avoiding duplicates

Abonare

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

Această întrebare a fost marcată
importcontacts
3 Răspunsuri
5668 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Fabio Tielen
Cel mai bun răspuns

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
Imagine profil
Abandonează
Manuel Alverdi
Autor

Brilliant

Imagine profil
Thuy Ngoc
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

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
Imagine profil
Abandonează
Manuel Alverdi
Autor

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!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
update contact list language encountering issue
import contacts
Imagine profil
0
mar. 24
1918
Importation contacts dans Odoo V17
import contacts
Imagine profil
0
dec. 23
2197
How do I know what field to import in to?
import contacts importing
Imagine profil
Imagine profil
1
ian. 24
2390
How do I import my contacts so they are placed within (linked to) the company for which they work? Rezolvat
import contacts companies
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
18
mar. 24
22092
Import contacts in Odoo14 Rezolvat
import contacts v14
Imagine profil
Imagine profil
1
mai 21
5142
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