akretion / ooor

Odoo Ruby JSON client. Emulates ActiveRecord enough (as much as Mongoid; Implements ActiveModel) to make Rails development with an Odoo datastore straightforward
MIT License
199 stars 59 forks source link

AttributeError: 'NoneType' object has no attribute 'fields_get' #145

Open rvalyi opened 8 years ago

rvalyi commented 8 years ago

on v9 + demo data, somethig like ProductProduct.find(15).seller_ids breaks with the following stack trace:

D, [2016-08-29T20:45:27.435859 #1325] DEBUG -- : registering ProductSupplierinfo
D, [2016-08-29T20:45:27.436148 #1325] DEBUG -- : OOOR object service: rpc_method: execute, db: db, uid: 1, pass: #, obj: product.supplierinfo, method: fields_get, *args: [false, {"lang"=>"en_US", "tz"=>"Europe/Brussels"}]
D, [2016-08-29T20:45:27.453083 #1325] DEBUG -- : 14 fields loaded in model ProductSupplierinfo
D, [2016-08-29T20:45:27.464230 #1325] DEBUG -- : OOOR object service: rpc_method: execute, db: db, uid: 1, pass: #, obj: product.supplierinfo, method: read, *args: [[43], ["create_date", "sequence", "date_end", "qty", "product_code", "id", "display_name", "__last_update", "date_start", "delay", "product_name", "price", "write_date", "min_qty", "product_uom", "currency_id", "create_uid", "company_id", "product_tmpl_id", "write_uid", "name", "product_id"], {"lang"=>"en_US", "tz"=>"Europe/Brussels"}]
D, [2016-08-29T20:45:27.482857 #1325] DEBUG -- : registering ResPartner
D, [2016-08-29T20:45:27.483403 #1325] DEBUG -- : OOOR object service: rpc_method: execute, db: db, uid: 1, pass: #, obj: res.partner, method: fields_get, *args: [false, {"lang"=>"en_US", "tz"=>"Europe/Brussels"}]
D, [2016-08-29T20:45:27.535287 #1325] DEBUG -- : 66 fields loaded in model ResPartner
D, [2016-08-29T20:45:27.582805 #1325] DEBUG -- : registering Cart
D, [2016-08-29T20:45:27.582986 #1325] DEBUG -- : OOOR login - db: db, username: admin
D, [2016-08-29T20:45:27.826542 #1325] DEBUG -- : OOOR object service: rpc_method: execute, db: db, uid: 1, pass: #, obj: cart, method: fields_get, *args: [false, {"lang"=>"en_US", "tz"=>"Europe/Brussels"}]
  Error: 

********************************************
***********     OOOR Request     ***********
method: method: fields_get - args: [false, {"lang"=>"en_US", "tz"=>"Europe/Brussels"}] - args: []
********************************************

********************************************
*********** OpenERP Server ERROR ***********
********************************************
Traceback (most recent call last):
  File "/workspace/parts/odoo/openerp/http.py", line 646, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/workspace/parts/odoo/openerp/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/workspace/parts/odoo/openerp/http.py", line 319, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/workspace/parts/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/workspace/parts/odoo/openerp/http.py", line 312, in checked_call
    result = self.endpoint(*a, **kw)
  File "/workspace/parts/odoo/openerp/http.py", line 962, in __call__
    return self.method(*args, **kw)
  File "/workspace/parts/odoo/openerp/http.py", line 512, in response_wrap
    response = f(*args, **kw)
  File "/workspace/parts/odoo/addons/web/controllers/main.py", line 898, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/workspace/parts/odoo/addons/web/controllers/main.py", line 890, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
AttributeError: 'NoneType' object has no attribute 'fields_get'

Odoo Server Error
********************************************
.
  /workspace/vendor/ooor/lib/ooor/transport/json_client.rb:44:in `oe_request'
/workspace/vendor/ooor/lib/ooor/transport/json_client.rb:24:in `oe_service'
/workspace/vendor/ooor/lib/ooor/services.rb:125:in `object_service'
/workspace/vendor/ooor/lib/ooor/base.rb:47:in `object_service'
/workspace/vendor/ooor/lib/ooor/base.rb:38:in `rpc_execute'
/workspace/vendor/ooor/lib/ooor/field_methods.rb:13:in `reload_fields_definition'
/workspace/vendor/ooor/lib/ooor/base.rb:46:in `object_service'
/workspace/vendor/ooor/lib/ooor/base.rb:38:in `rpc_execute'
/workspace/vendor/ooor/lib/ooor/base.rb:56:in `method_missing'