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

Error in Messaging App: ValueError: Invalid field 'state' in leaf "<osv.ExtendedLeaf: ('state', 'in', ['draft', 'sent', 'cancel']) on mail_message (ctx: )>"

S'inscrire

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

Cette question a été signalée
22 Réponses
23046 Vues
Avatar
Jörg Ricardo Schumacher

Hello, we played around a little bit on our Test Server and only one of our users has this error when trying to open up the messages application:

ValueError: Invalid field 'state' in leaf "<osv.ExtendedLeaf: ('state', 'in', ['draft', 'sent', 'cancel']) on mail_message (ctx: )>"

 

Below, you can find som more Infos on the Stack. Does anyone know what could be the reason for this?

 

File "/opt/odoo/odoo-server/openerp/models.py", line 4332, in _where_calc e = expression.expression(cr, user, domain, self, context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 646, in __init__ self.parse(cr, uid, context=context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 812, in parse raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf))) ValueError: Invalid field 'state' in leaf "<osv.ExtendedLeaf: ('state', 'in', ['draft', 'sent', 'cancel']) on mail_message (ctx: )>"

2
Avatar
Ignorer
Jörg Ricardo Schumacher
Auteur

Still nobody with a solution on this?

Avatar
Samir Hussein
Meilleure réponse

Hello Jörg,

I had the same issue regarding only two users which had the error. I found a way to solve it, hopefuly it will work for you (if you still have it).

Here is what i did:

1. Go to the "Configuration" menu

2. Go to the "Security" in the menu on the left of the window

3. Select "Records rules"

4. Find the different records rules which use the field  'state', 'in', ['draft', 'sent', 'cancel'] (i had at least 5 of them)

5. Modify the rule by unchecking the "Activ" checkbox and save it

6. Do so for every rules that use the field 'state' (don't forget to check it before)


I hope this will help you, it worked for us



1
Avatar
Ignorer
wizardz

It worked well, thanks

Samir Hussein

Hi Diezcode, sorry but what worked well?

Avatar
Piyush Suva
Meilleure réponse

make sure you defined 'state' field in tree/form view of your object.

run the cmd through terminal

python openerp-server -u all -d <database_name>

hop it will solve your problem

2
Avatar
Ignorer
Jörg Ricardo Schumacher
Auteur

Unfortunately, I do not understand what you are trying to tell me.

Piyush Suva

run the cmd through terminal python openerp-server -u all -d hop it will solve your problem

Jörg Ricardo Schumacher
Auteur

Hello Piush, thank you for your effort. Unfortunately, your command didn't execute: root@v22014102320741:~# python: can't open file 'openerp-server': [Errno 2] No such file or directory > ^C root@v220141023020741:~# root@v22014102323020741:~# python odoo-server -u all -d hop root@v220141023020741:~#: command not found

Piyush Suva

python odoo-server -u all -d YOUR DATABASE NAME

Jörg Ricardo Schumacher
Auteur

root@v220142323020741:~# python odoo-server -u all -d myTESTdb python: can't open file 'odoo-server': [Errno 2] No such file or directory

Piyush Suva

1) go to your odoo server directory though 'cd' command . where 'odoo-server' file will be there.. 2) then run the abov command: python odoo-server -u all -d myTESTdb

Jörg Ricardo Schumacher
Auteur

Hello Piyush, I managed to execute the command now by 1. switching to the user running odoo Server: su odoo 2. Navigating to the odoo installation folder 3. Issuing your command with the Database: python openerp-server -u all -d myTESTdb . In runs a lot of things. Besides the fact that I do not know what this command does, (is it starting a second server instance?) it did not solve the problem (at least not on the first server instance that was running all the time). As the error is user- AND document-based, I would think it is enough to delete the document causing the error... but how do I find it? Thank you and brgds...

Avatar
Nirav Jani
Meilleure réponse

Hello,

State field is not in "mail.message" object so that give error.

1
Avatar
Ignorer
Jörg Ricardo Schumacher
Auteur

It appears in the messaging menu and in the Sales Menu, when I open up the Sales Order S0002 . The Sales Order was created by another user and thereafter "shared" with the user that gets the error.

Nirav Jani

It is working...No Error..

Nirav Jani

Hello you customize module or used core addons ??

Jörg Ricardo Schumacher
Auteur

Hello Nirav, no I did not customize any of the modules. We are tlking about a really fresh odoo installation and just on single email was sent.

Jörg Ricardo Schumacher
Auteur

Here is the full stack trace: File "/opt/odoo/odoo-server/openerp/http.py", line 500, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 517, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 283, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 280, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 733, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 376, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 944, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 936, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 564, in message_read parent_tree[tree_parent_id].append(self._message_read_dict(cr, uid, message_tree[message_id], parent_id=tree_parent_id, context=context)) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 398, in _message_read_dict 'to_read': message.to_read, File "/opt/odoo/odoo-server/openerp/fields.py", line 754, in __get__ self.determine_value(record) File "/opt/odoo/odoo-server/openerp/fields.py", line 849, in determine_value record._prefetch_field(self) File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3154, in _prefetch_field result = records.read(list(fnames), load='_classic_write') File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/api.py", line 552, in new_api result = method(self._model, cr, uid, self.ids, *args, **kwargs) File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 823, in read res = super(mail_message, self).read(cr, uid, ids, fields=fields, context=context, load=load) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3069, in read result = BaseModel.read(records, fields, load=load) File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3101, in read self._read_from_database(stored) File "/opt/odoo/odoo-server/openerp/api.py", line 235, in wrapper return new_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 3263, in _read_from_database res2 = self._columns[f].get(cr, self._model, ids, f, user, context=context, values=result) File "/opt/odoo/odoo-server/openerp/osv/fields.py", line 1312, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 89, in _get_to_read ], context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 1673, in search return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4510, in _search self._apply_ir_rules(cr, user, query, 'read', context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4387, in _apply_ir_rules rule_where_clause, rule_where_clause_params, rule_tables = rule_obj.domain_get(cr, uid, self._name, mode, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_rule.py", line 156, in domain_get query = self.pool[model_name]._where_calc(cr, SUPERUSER_ID, dom, active_test=False) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4332, in _where_calc e = expression.expression(cr, user, domain, self, context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 646, in __init__ self.parse(cr, uid, context=context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 847, in parse right_ids = comodel.search(cr, uid, [(path[1], operator, right)], context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/calendar/calendar.py", line 1705, in search return super(mail_message, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 1673, in search return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/portal/mail_message.py", line 38, in _search context=context, count=count, access_rights_uid=access_rights_uid) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/addons/mail/mail_message.py", line 621, in _search context=context, count=count, access_rights_uid=access_rights_uid) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4509, in _search query = self._where_calc(cr, user, args, context=context) File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4332, in _where_calc e = expression.expression(cr, user, domain, self, context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 646, in __init__ self.parse(cr, uid, context=context) File "/opt/odoo/odoo-server/openerp/osv/expression.py", line 812, in parse raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf))) ValueError: Invalid field 'state' in leaf ""

Avatar
Ankit H Gandhi(AHG)
Meilleure réponse

Hello Jorg,

I have face same issue and I solved out that.

Solutions:

You need check action of that model using below query.

select name,domain,id from ir_act_window where res_model='your.modelname';

Now update domain field value as empty list([])

update ir_act_window set domain='[]' where id=Give id;

Hope above solution will be help

Best Thanks,

Ankit H Gandhi.

0
Avatar
Ignorer
Avatar
dharupriyanshi@gmail.com
Meilleure réponse

i get similar problem when i click on any leads , my domain rule is 

['|',('user_id','=',user.id),('message_partner_ids','child_of',[user.commercial_partner_id.id])]

and i get error

aise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))ValueError: Invalid field 'user_id' in leaf "<osv.ExtendedLeaf: ('user_id', '=', 8) on mail_followers (ctx: )>"


i used this domain under "personal leads" record rule and model is crm.lead

0
Avatar
Ignorer
Avatar
Jörg Ricardo Schumacher
Auteur Meilleure réponse

Hello Nirav,

 

can you explain further, please, and how to resolve the problem?

0
Avatar
Ignorer
Nirav Jani

Yes, tell me when error come means what to do on which module (sale or purchase) ??

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
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