Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
attributeerrorboolodooV8
2 Odgovori
15278 Prikazi
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
Opusti
Chris Zajaczkowski

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

Nehemias Herrera
Avtor

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
I got this error AttributeError: 'list' object has no attribute 'id' Solved
list attributeerror odooV8
Avatar
Avatar
1
dec. 23
54651
AttributeError : Field does not exist
attributeerror odooV8 declaration
Avatar
Avatar
Avatar
2
mar. 16
7888
CONFIGURACION DE CORREO PROPIO POR PRUMERA VEZ
odooV8
Avatar
0
mar. 25
2010
How to remove model if not in the py files anymore
odooV8
Avatar
0
jan. 25
4284
Start odoo server automatically in Ubuntu 14.04 on reboot Solved
odooV8
Avatar
Avatar
1
avg. 23
15925
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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