Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

TypeError: 'int' object is not iterable - when translating a blog title from Chinese to English

By
August Doo
on 9/24/14, 6:17 PM 3,249 views

Hi all, what does the following msg mean when I tried to translate one blog title from Chinese to English.

 

OpenERP

OpenERP Server Error

Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/http.py", line 462, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 481, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 297, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 294, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 677, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 346, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 1049, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 1041, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_translation.py", line 366, in write result = super(ir_translation, self).write(cursor, user, ids, vals, context=context) File "/opt/odoo/odoo-server/openerp/osv/orm.py", line 3980, in write result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or [] File "/opt/odoo/odoo-server/openerp/osv/fields.py", line 1294, in set self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context) File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_translation.py", line 193, in _set_src model.write(cr, uid, record.res_id, {field: value}, context=context_wo_lang) File "/opt/odoo/odoo-server/addons/website_blog/models/website_blog.py", line 185, in write self.create_history(cr, uid, ids, vals, context) File "/opt/odoo/odoo-server/addons/website_blog/models/website_blog.py", line 162, in create_history for i in ids: TypeError: 'int' object is not iterable

Cheers,

August

0
Pau Ubach
On 10/10/14, 2:15 AM

In your case, ids is an int, not an object you can iterate. So, you have to options:

  1. Instead of use for i in ids just work directly with ids.
  2. or add ids = [ids] before the error line

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 9/24/14, 6:17 PM
Seen: 3249 times
Last updated: 3/16/15, 8:10 AM