Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pos_remove_pos_category - KeyError: 'module' #57

Closed
saltonmassally opened this issue Oct 4, 2015 · 6 comments
Closed

pos_remove_pos_category - KeyError: 'module' #57

saltonmassally opened this issue Oct 4, 2015 · 6 comments
Milestone

Comments

@saltonmassally
Copy link

Cannot create model field from the UI as this results in an error in
pos_remove_pos_category/product.py", line 63, in _auto_end

@andhit-r
Copy link
Member

I also encountered with this problem

@osadmn
Copy link

osadmn commented Apr 28, 2016

Me too. How can we fix this?

@legalsylvain
Copy link
Contributor

legalsylvain commented Apr 28, 2016

Hi Can you detail when the error occure, plz, which version of the module, ...

regards.

@andhit-r
Copy link
Member

Hi @legalsylvain. Here are the details:

  1. I clone OCA/pos repo
  2. I registered OCA/pos repo into my addons
  3. I edit any models through UI. I add custom field trough UI
  4. Exception raised:

Traceback (most recent call last):
File "/opt/odoo/odoo/openerp/http.py", line 539, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo/openerp/http.py", line 576, in dispatch
result = self._call_function(*_self.params)
File "/opt/odoo/odoo/openerp/http.py", line 312, in _call_function
return checked_call(self.db, *args, *_kwargs)
File "/opt/odoo/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/http.py", line 309, in checked_call
return self.endpoint(_a, *_kw)
File "/opt/odoo/odoo/openerp/http.py", line 805, in call
return self.method(_args, *_kw)
File "/opt/odoo/odoo/openerp/http.py", line 405, in response_wrap
response = f(_args, *_kw)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 944, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/addons/base/ir/ir_model.py", line 205, in write
return super(ir_model,self).write(cr, user, ids, vals, context)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 399, in old_api
result = method(recs, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3788, in write
self._write(old_vals)
File "/opt/odoo/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/api.py", line 592, in new_api
result = method(self._model, cr, uid, self.ids, _args, *_old_kwargs)
File "/opt/odoo/odoo/openerp/models.py", line 3932, in _write
result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []
File "/opt/odoo/odoo/openerp/osv/fields.py", line 798, in set
id_new = obj.create(cr, user, act[2], context=context)
File "/opt/odoo/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, _args, *_kwargs)
File "/opt/odoo/odoo/openerp/addons/base/ir/ir_model.py", line 400, in create
model._auto_end(cr, ctx) # actually create FKs!
File "/opt/odoo/oca_pos/pos_remove_pos_category/product.py", line 79, in _auto_end
module = context['module']
KeyError: 'module'

As you can see that product.py from pos_remove_pos_category cause this. I even does not install pos_remove_pos_category

@legalsylvain legalsylvain added this to the 8.0 milestone Sep 21, 2016
carlosrve added a commit to ClearCorp/oca-pos that referenced this issue Jan 19, 2017
carlosrve added a commit to ClearCorp/oca-pos that referenced this issue Jan 19, 2017
[FIX] BUG OCA#57 that does not allow to create fields in the UI.
@carlosrve
Copy link

I just uploaded a pull request to fix this.

@pedrobaeza
Copy link
Member

Closing as there's a PR.

pedrobaeza added a commit that referenced this issue Jan 20, 2017
[FIX] BUG #57 that does not allow to create fields in the UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants