Skip to Content
Menu
This question has been flagged
1 Reply
20469 Views

Module install fine, however when I update the module it get this error:

AttributeError: 'NoneType' object has no attribute '_fields'

A bit of background, I am trying to make a bespoke quote module and have been using the sales module as a reference point. I have narrowed down the issue to the field:

tax_id = fields.Many2many('account.tax', string='Taxes', domain=['|', ('active', '=', False), ('active', '=', True)])

But I just can't figure out the reason behind the error.

Full Log

Error:

Odoo Server Error

Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/odoo/odoo-server/odoo/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 939, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 938, in call_button
action = self._call_kw(model, method, args, {})
File "/odoo/odoo-server/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "</usr/local/lib/python3.6/dist-packages/decorator.py:decorator-gen-48>", line 2, in button_immediate_upgrade
File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 72, in check_and_log
return method(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 613, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "/odoo/odoo-server/odoo/addons/base/module/module.py", line 552, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/odoo/odoo-server/odoo/modules/registry.py", line 85, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 376, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/odoo/odoo-server/odoo/modules/loading.py", line 274, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/odoo/odoo-server/odoo/modules/loading.py", line 152, in load_module_graph
registry.setup_models(cr)
File "/odoo/odoo-server/odoo/modules/registry.py", line 280, in setup_models
model._setup_complete()
File "/odoo/odoo-server/odoo/models.py", line 2464, in _setup_complete
field.setup_triggers(self)
File "/odoo/odoo-server/odoo/fields.py", line 699, in setup_triggers
for model, field, path in self.resolve_deps(model):
File "/odoo/odoo-server/odoo/fields.py", line 677, in resolve_deps
field = model._fields[fname]
AttributeError: 'NoneType' object has no attribute '_fields'
Avatar
Discard
Best Answer

The model variable is not getting set (None). 

Avatar
Discard
Related Posts Replies Views Activity
1
May 18
5356
3
Jul 20
10013
4
Oct 24
3680
0
Sep 17
3155
0
Nov 16
2750