Skip to Content
Menu
This question has been flagged
2 Replies
2915 Views

When clicking on create I get this error:


Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 796, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 396, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 928, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 363, in old_api

result = method(recs, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5817, in onchange

record.mapped(field_seq)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5339, in mapped

recs = recs._mapped_func(operator.itemgetter(name))

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5323, in _mapped_func

vals = [func(rec) for rec in self]

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5557, in __getitem__

return self._fields[key].__get__(self, type(self))

KeyError: 'aquise'


The field is there and gives no problem with edit or add, just with create.

Code:


class profile_aquise(osv.Model):

_name = "profile.aquise"

_columns = {

"name": fields.char("Akquise", size=32)

}

in main class:

"aquise.id": fields.many2one("profile.aquise", "Akquise"),

in view file:

<field name="aquise.id" />


Can anyone help

Avatar
Discard
Best Answer

Hi,

just change according to below.


"aquise_id": fields.many2one("profile.aquise", "Akquise"),

in view file:

<field name="aquise_id" />

I hope your issue will resolve. Because when you have put "." then system is going to fetch another field in the model. So, just remove that "." and put "_" in field defination. thats it.


Avatar
Discard
Best Answer

Replace dot from "aquise.id"  to "aquise_id"  from both py and xml file.


Avatar
Discard
Related Posts Replies Views Activity
0
Oct 15
2573
2
May 15
3410
1
Mar 15
2457
0
Nov 23
372
1
Mar 22
856