Skip to Content
Odoo Menu
  • Sign in
  • Teste-o gratuitamente
  • Aplicações
    Finanças
    • Contabilidade
    • Faturação
    • Despesas
    • Folha de cálculo (BI)
    • Documentos
    • Assinatura eletrónica
    Vendas
    • CRM
    • Vendas
    • POS para lojas
    • POS para restaurantes
    • Subscrições
    • Aluguer
    Sites
    • Criador de Sites
    • Comércio eletrónico
    • Blogue
    • Fórum
    • Chat em direto
    • e-Learning
    Cadeia de abastecimento
    • Inventário
    • Produção
    • PLM
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Colaboradores
    • Recrutamento
    • Ausências
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Marketing social
    • Marketing por e-mail
    • Marketing através de SMS
    • Eventos
    • Automação de Marketing
    • Inquéritos
    Serviços
    • Projeto
    • Registos de Horas
    • Assistência no local
    • Assistência
    • Planeamento
    • Agendamentos
    Produtividade
    • Conversas
    • Inteligência artificial
    • IoT
    • VoIP
    • Informação
    • WhatsApp
    Aplicações de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Retalho
    • Livraria
    • Loja de roupa
    • Loja de móveis
    • Mercearia
    • Loja de ferragens
    • Loja de brinquedos
    Alimentação e hotelaria
    • Bar e pub
    • Restaurante
    • Comida rápida
    • Casa de hóspedes
    • Distribuidor de bebidas
    • Hotel
    Imobiliário
    • Agência imobiliária
    • Gabinete de arquitectura
    • Construção
    • Gestão imobiliária
    • Jardinagem
    • Associação de proprietários
    Consultoria
    • Gabinete de contabilidade
    • Parceiro da Odoo
    • Agência de marketing
    • Sociedade de advogados
    • Aquisição de talentos
    • Auditoria e certificação
    Produção
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Brindes promocionais
    Saúde e bem-estar
    • Clube desportivo
    • Ótica
    • Ginásio
    • Profissionais de bem-estar
    • Farmácia
    • Cabeleireiro
    Ofícios
    • Handyman
    • Hardware e suporte técnico
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência do ambiente
    • Aluguer de painéis publicitários
    • Estúdio de fotografia
    • Aluguer de bicicletas
    • Revendedor de software
    Explorar todos os setores
  • Comunidade
    Aprender
    • Tutoriais
    • Documentação
    • Certificações
    • Treino
    • Blogue
    • Podcast
    Capacitar a educação
    • Programa de formação
    • Scale Up! O jogo de negócios
    • Visite a Odoo
    Obter o software
    • Transferir
    • Comparar Edições
    • Versões
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Registe a sua empresa contabilística
    • Programa de afiliados
    Obter serviços
    • Encontre um parceiro
    • Encontre um contabilista
    • Contacte um consultor
    • Serviços de implementação
    • Referências de clientes
    • Apoio
    • Atualizações
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar uma demonstração
  • Preços
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
attributeerrorboolodooV8
2 Replies
17049 Views
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
Discard
Chris Zajaczkowski

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

Nehemias Herrera
Author

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
Discard
Avatar
Nehemias Herrera
Author 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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
I got this error AttributeError: 'list' object has no attribute 'id' Solved
list attributeerror odooV8
Avatar
Avatar
1
dez. 23
56190
AttributeError : Field does not exist
attributeerror odooV8 declaration
Avatar
Avatar
Avatar
2
mar. 16
9293
repeated song nowadays
odooV8
Avatar
0
jul. 26
5
◤®🤷‍♀️GUÍA✈Jet-Blue Teléfono República Dominicana🎉◥ GUÍA Jet-Blue República Dominicana GUÍA
odooV8
Avatar
0
jun. 26
0
{{Hablar@Representante@Klm}} ¿Cómo llamar a KLM desde Panamá?
odooV8
Avatar
0
jun. 26
93
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Código aberto
  • Transferir
  • Github
  • Runbot
  • Traduções
Serviços
  • Alojamento Odoo.sh
  • Apoio
  • Atualizar Versão
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um contabilista
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • A Nossa Empresa
  • Ativos da marca
  • Contacte-nos
  • Trabalhos
  • Eventos
  • Podcast
  • Blogue
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) Português română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

O Odoo é um conjunto de aplicações empresariais de código aberto que abrange todas as necessidades da sua empresa: CRM, comércio eletrónico, contabilidade, gestão de inventário, ponto de venda, gestão de projetos, etc.

A proposta de valor única do Odoo é ser, ao mesmo tempo, muito fácil de utilizar e totalmente integrado.

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