Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Odoo12c: How to remove model/data after removing app?

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
migrationhelpdeskodoo12
1 Répondre
8526 Vues
Avatar
Russ Schneider

Odoo 12 Community Edition
Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64)

I've downgraded an Odoo instance from 11e to 11ce and then migrated it to 12ce using OCA Open Upgrade and have a problem with leftover data.

While I've deleted the app "Helpdesk" and related modules, helpdesk_sale_timesheet and helpdesk_timesheet, they still appear in the data.

For instance​. the model helpdesk.ticket still exists in the database, and I cannot delete it because:

Model 'Ticket' co​ntains module data and cannot be removed.

This is also breaking the Discuss (mail) app as I cannot go to the Discuss page.  Error:
​

```

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/opt/odoo12/odoo/odoo/http.py", line 656, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/opt/odoo12/odoo/odoo/http.py", line 314, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/opt/odoo12/odoo/odoo/tools/pycompat.py", line 87, in reraise

    raise value

  File "/opt/odoo12/odoo/odoo/http.py", line 698, in dispatch

    result = self._call_function(**self.params)

  File "/opt/odoo12/odoo/odoo/http.py", line 346, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/opt/odoo12/odoo/odoo/service/model.py", line 97, in wrapper

    return f(dbname, *args, **kwargs)

  File "/opt/odoo12/odoo/odoo/http.py", line 339, in checked_call

    result = self.endpoint(*a, **kw)

  File "/opt/odoo12/odoo/odoo/http.py", line 941, in __call__

    return self.method(*args, **kw)

  File "/opt/odoo12/odoo/odoo/http.py", line 519, in response_wrap

    response = f(*args, **kw)

  File "/opt/odoo12/odoo-custom-addons/mail_tracking/controllers/main.py", line 91, in mail_init_messaging

    values = super().mail_init_messaging()

  File "/opt/odoo12/odoo/odoo/http.py", line 519, in response_wrap

    response = f(*args, **kw)

  File "/opt/odoo12/odoo/addons/mail/controllers/main.py", line 243, in mail_init_messaging

    'mail_failures': request.env['mail.message'].message_fetch_failed(),

  File "/opt/odoo12/odoo/addons/mail/models/mail_message.py", line 422, in message_fetch_failed

    return messages._format_mail_failures()

  File "/opt/odoo12/odoo/addons/mail/models/mail_message.py", line 544, in _format_mail_failures

    record = self.env[message.model].browse(message.res_id)

  File "/opt/odoo12/odoo/odoo/api.py", line 831, in __getitem__

    return self.registry[model_name]._browse((), self)

  File "/opt/odoo12/odoo/odoo/modules/registry.py", line 176, in __getitem__

    return self.models[model_name]

KeyError: 'helpdesk.ticket'

```

I've taken the following steps to try and remove this data:
​

  • Removed the module directories from the server

  • ./odoo-bin --update all

  • service odoo restart -u all

  • Apps -> List mode -> Checkbox -> Delete for helpdesk

  • Remove and reinstall Discuss (mail)


What else can I do?







0
Avatar
Ignorer
Avatar
Ray Carnes (ray)
Meilleure réponse

I would try deleting mail.message records linked to the helpdesk.ticket model - the error indicates the custom mail_tracking module is triggering the error and I suspect it is trying to do something with messages linked to the helpdesk App.

1
Avatar
Ignorer
Russ Schneider
Auteur

How? I get the above error if I try to delete them. Is there a way to do it directly in the database (making sure you get everything)?

Ray Carnes (ray)

Try: DELETE FROM MAIL.MESSAGE WHERE MODEL = 'helpdesk.ticket';

Russ Schneider
Auteur

Seems to have worked. Thank you!

Russ Schneider
Auteur

Although mail_message (for those needing this).

Yenthe Van Ginneken (Mainframe Monkey)

OCA has some great tools for data cleaning and cleaning up apps too by the way. Adding it as a reference here. See https://www.odoo.com/apps/modules/12.0/database_cleanup/

Russ Schneider
Auteur

Thank you, Yenthe. That's a great tool!

Admin Samadeva

As Yenthe said, the OCA DatabaseCleanUp module does the job, but what is the right way to remove totally a custom model without using this kind of "Emergency" cleanup module ?

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Error during import in Odoo 12 - Security restriction Résolu
migration odoo12
Avatar
Avatar
2
juil. 21
11898
Substitute Function For _get_tax_amount_by_group(self) in odoo12? Résolu
migration odoo12
Avatar
Avatar
1
juil. 19
4860
Odoo 12 helpdesk ticket assignment shows all groups members
helpdesk odoo odoo12
Avatar
0
mars 23
3275
How to migrate custom addons from odoo12 to odoo15 from odoo.sh with existing data?
migration odoo12 v15
Avatar
0
juil. 22
3138
AttributeError: module 'odoo.addons.base.models.ir_module' has no attribute 'get_values_from_terp' Résolu
migration odoo12 v14
Avatar
Avatar
1
juil. 21
9236
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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