Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

AttributeError: 'bool' object has no attribute '_setup_fields'

Subscriure's

Get notified when there's activity on this post

This question has been flagged
attributeerrorboolodooV8
2 Respostes
15299 Vistes
Avatar
Nehemias Herrera

Hi, I am using nightly version 8.0.20141208, after trying to install my module, I am getting this error

Traceback (most recent call last):
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 517, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 538, in dispatch
    result = self._call_function(**self.params)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 294, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 291, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 754, in __call__
    return self.method(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 387, in response_wrap
    response = f(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/web/controllers/main.py", line 953, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/base/module/module.py", line 450, in button_immediate_install
    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/base/module/module.py", line 498, in _button_immediate_function
    registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/registry.py", line 341, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 358, in load_modules
    loaded_modules, update_module)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 263, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 162, in load_module_graph
    registry.setup_models(cr, partial=True)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/registry.py", line 169, in setup_models
    model._setup_fields(cr, SUPERUSER_ID, context=context)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 332, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/models.py", line 2963, in _setup_fields
    field.setup(self.env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 411, in setup
    self._setup(env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 1374, in _setup
    super(_Relational, self)._setup(env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 419, in _setup
    self._setup_regular(env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 1659, in _setup_regular
    comodel._setup_fields()
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 235, in wrapper
    return new_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/models.py", line 2963, in _setup_fields
    field.setup(self.env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 411, in setup
    self._setup(env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 417, in _setup
    self._setup_related(env)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 448, in _setup_related
    recs._setup_fields()
AttributeError: 'bool' object has no attribute '_setup_fields'


There's not a single bool field in my code, I can't understand the reason of the error, thanks.

0
Avatar
Descartar
Chris Zajaczkowski

Looks like 'recs' gets return False from call rather then recordset. Try to add a check in your code.

Nehemias Herrera
Autor

please read the post below, this error was happening because I changed _inherits = {'res.partner':'partner_id'} for _inherits = {'res.partner':'id'}

Avatar
Ivan
Best Answer

It is not refering to Boolean (not bool) fields but the fact (from the error message) recs has no value, which is usually assigned as False and hence has bool type.  The error is generated (from the tracebak) from _setup_related method, which, according to the source code: Setup the attributes of a related field.  So, I would suggest that you check any fields that has related attribute.

1
Avatar
Descartar
Avatar
Nehemias Herrera
Autor Best Answer

The previous error comes after I made a modification to my model, I am trying to inherit from res.partner, I copied the code from res_users.py since it already inherits from res.partner, so, this is my model:


# -*- coding: utf-8 -*-
from openerp import fields
from openerp import models

class Test (models.Model):
    _name = 'test'
    _inherits = {'res.partner':'partner_id'}

    sample_field = fields.Char(string="Field")

with it I get this error:


[Fri Feb 13 22:44:17.770757 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0] mod_wsgi (pid=2125): Exception occurred processing WSGI script '/opt/bitnami/apps/odoo/scripts/openerp.wsgi'.
[Fri Feb 13 22:44:17.770846 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0] Traceback (most recent call last):
[Fri Feb 13 22:44:17.770878 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/service/wsgi_server.py", line 216, in application
[Fri Feb 13 22:44:17.772492 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return application_unproxied(environ, start_response)
[Fri Feb 13 22:44:17.772544 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/service/wsgi_server.py", line 202, in application_unproxied
[Fri Feb 13 22:44:17.772588 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     result = handler(environ, start_response)
[Fri Feb 13 22:44:17.772599 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 1236, in __call__
[Fri Feb 13 22:44:17.774421 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return self.dispatch(environ, start_response)
[Fri Feb 13 22:44:17.774467 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 1210, in __call__
[Fri Feb 13 22:44:17.774506 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return self.app(environ, start_wrapped)
[Fri Feb 13 22:44:17.774530 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/python/lib/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/werkzeug/wsgi.py", line 411, in __call__
[Fri Feb 13 22:44:17.775786 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return self.app(environ, start_response)
[Fri Feb 13 22:44:17.775820 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 1368, in dispatch
[Fri Feb 13 22:44:17.775900 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     ir_http = request.registry['ir.http']
[Fri Feb 13 22:44:17.775923 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/http.py", line 330, in registry
[Fri Feb 13 22:44:17.775946 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
[Fri Feb 13 22:44:17.775960 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/registry.py", line 310, in get
[Fri Feb 13 22:44:17.776184 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     update_module)
[Fri Feb 13 22:44:17.776207 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/registry.py", line 341, in new
[Fri Feb 13 22:44:17.776232 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     openerp.modules.load_modules(registry._db, force_demo, status, update_module)
[Fri Feb 13 22:44:17.776245 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 354, in load_modules
[Fri Feb 13 22:44:17.776444 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     force, status, report, loaded_modules, update_module)
[Fri Feb 13 22:44:17.776466 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 263, in load_marked_modules
[Fri Feb 13 22:44:17.776492 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
[Fri Feb 13 22:44:17.776506 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/loading.py", line 228, in load_module_graph
[Fri Feb 13 22:44:17.776523 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     registry.setup_models(cr, partial=True)
[Fri Feb 13 22:44:17.776535 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/modules/registry.py", line 169, in setup_models
[Fri Feb 13 22:44:17.776552 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     model._setup_fields(cr, SUPERUSER_ID, context=context)
[Fri Feb 13 22:44:17.776568 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 237, in wrapper
[Fri Feb 13 22:44:17.776851 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     return old_api(self, *args, **kwargs)
[Fri Feb 13 22:44:17.776881 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/api.py", line 332, in old_api
[Fri Feb 13 22:44:17.776898 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     result = method(recs, *args, **kwargs)
[Fri Feb 13 22:44:17.776916 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/models.py", line 2963, in _setup_fields
[Fri Feb 13 22:44:17.778493 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     field.setup(self.env)
[Fri Feb 13 22:44:17.778531 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 411, in setup
[Fri Feb 13 22:44:17.779042 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     self._setup(env)
[Fri Feb 13 22:44:17.779066 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 417, in _setup
[Fri Feb 13 22:44:17.779095 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     self._setup_related(env)
[Fri Feb 13 22:44:17.779109 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]   File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/fields.py", line 449, in _setup_related
[Fri Feb 13 22:44:17.779125 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0]     field = recs._fields[name]
[Fri Feb 13 22:44:17.779157 2015] [:error] [pid 2125:tid 139651321841408] [remote 192.168.2.64:0] KeyError: 'partner_id'

If I remove  _inherits = {'res.partner':'partner_id'}  it works fine, I don't understand why is this giving me an error if I am inheriting the same way res_users.py does it https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_users.py#L143-L145

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
I got this error AttributeError: 'list' object has no attribute 'id' Solved
list attributeerror odooV8
Avatar
Avatar
1
de des. 23
54662
AttributeError : Field does not exist
attributeerror odooV8 declaration
Avatar
Avatar
Avatar
2
de març 16
7892
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
Avatar
0
de març 25
2017
How to remove model if not in the py files anymore
odooV8
Avatar
0
de gen. 25
4290
Start odoo server automatically in Ubuntu 14.04 on reboot Solved
odooV8
Avatar
Avatar
1
d’ag. 23
15927
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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