Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Deleting a variant in a product - Odoo 14

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
productvariantvariants
3 Risposte
3455 Visualizzazioni
Avatar
JEREMY GOBARD

Hello,

My products have multiple variants : size, location, color, ...

I need to remove all "size" variants from my products, but I always get an error in my automatic imports. I manage 20 000 products and cannot update it one by one.

Anyone would have an idea on what to do?


Best

Jeremy

0
Avatar
Abbandona
Avatar
Sergio Infante
Risposta migliore

Hi Jeremy & Christophe

Totally get it — handling attributes like Size across 20,000 products in Odoo 14 can get tricky fast, especially with imports. The issue you’re facing is pretty common and usually tied to how Odoo 14 manages attribute lines and variant regeneration.

In Odoo 14, product variants are tightly linked to the attribute lines on the product template. If your import tries to remove an attribute (like “Size”) that’s actively generating variants, Odoo throws errors because it can’t reconcile the variant definitions.

Here’s how you can cleanly remove the “Size” attribute in bulk:

Step 1: Identify and unlink “Size” from attribute lines

Use the model product.template.attribute.line — export the records where attribute_id = Size.

In your export (via Excel or CSV):

  • Include fields: id, product_tmpl_id/id, attribute_id/id, value_ids/id

Then, either:

  • Manually delete those lines via the UI (tedious)
  • Or import a file with just the id column and leave all other fields empty to remove the line — or write a small script to unlink them.

Step 2: Remove obsolete variants

After removing the attribute lines, Odoo won’t automatically delete the existing product variants that had Size. You’ll need to remove them manually or through a script:

# WARNING: Use with caution. Only run after unlinking attribute lines.


size_attr = env['product.attribute'].search([('name', '=', 'Size')])

variant_ids = env['product.product'].search([

    ('product_template_attribute_value_ids.attribute_id', '=', size_attr.id)

])

variant_ids.unlink()

Make sure those variants aren't tied to existing sales ordes, stock moves or accounting records, otherwise odoo won't let you delete them.

Step 3: Rebuild your variants (optional)

If your products now only need Color or Location, you can go to each template and click “Update Variants” or trigger it via code. In Odoo 14, this sometimes has to be done template by template unless you automate it.

Tips for keeping it clean going forward

  • Disable the Size attribute (active = False) so it’s not reused in the future.
  • Add logic to your import scripts to exclude deprecated attributes.
  • If you’re doing catalog management at this scale regularly, consider a small module that gives you admin tools to clean attributes in bulk.

Let me know if you want help generating an import file or action script for this — no way you’re doing 20,000 one by one.

0
Avatar
Abbandona
Avatar
Dương Nguyễn
Risposta migliore

Export those product template that contain size attribute then remember to choose external_id and product_variant_ids, attribute_line_ids and then it will give you a csv file
Then delete all data in column of variant and attribute
Then import back again in odoo done

Remember if some products exist in Sale Order or Pos Order you will need to handle them first

0
Avatar
Abbandona
Avatar
Christophe Bauwens
Risposta migliore

I have the same question for weeks.. No one has an answer :(

0
Avatar
Abbandona
Dương Nguyễn

Export those product template that contain size attribute then remember to choose external_id and product_variant_ids, attribute_line_ids and then it will give you a csv file
Then delete all data in column of variant and attribute
Then import back again in odoo done

Remember if some products exist in Sale Order or Pos Order you will need to handle them first

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Merging Separate Products into Variants in Odoo
product variant variants
Avatar
Avatar
2
giu 25
1324
Product variants combination
product variant variants
Avatar
Avatar
Avatar
4
gen 18
8984
Dynamic Product Variants from Attributes: Odoo creates all Variants upon Purchase Order in Odoo 15
product variant product.product variants
Avatar
Avatar
Avatar
2
ott 25
6103
Pricing Variants
product pricing variant variants
Avatar
0
mar 23
2610
Variant prices
product variant pricelist variants
Avatar
Avatar
Avatar
Avatar
4
mar 16
9195
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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