"object of type 'int' has no len()"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Web Client |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Hi,
this bug is for web client 6.0 (perhaps for 5.0 too)
I saw some bugs with this message "object of type 'int' has no len()" , but seems to be not this I had, I explain :
I have 2 classes.
For each class, I have 2 fields type many2many (then, there is a total of 4 m2m for the 2 classes)
I want to update values of the first class with values of the second class (there is a common key between them naturally), the first field of the class one is updated with the first field of the class two, the second field of the class one is updated with the second field of the class two, using the common key of the 2 fields of the two classes (the key is a type integer).
to update the first class with the second I use an on_change method, inwhich I return the result with return {'value': res}
This return works with client gtk, but with client web I have this error when I do "save" for the form :
84 if (self.ids or self.id) and self.count == 0:
85 if self.ids and len(self.ids) < self.limit:
86 self.count = len(self.ids)
87 else:
self = Screen, self.ids = 11, builtin len = <built-in function len>, self.limit = 50
<type 'exceptions.
args = ("object of type 'int' has no len()",)
message = "object of type 'int' has no len()"
If I try to return just one field (the one or the second), it works in client web too.
I find a patch to solve this bug by changing in client web (in fact I do a list of integer which can be read by method len() :
in openerp-
-if self.ids and len(self.ids) < self.limit:
+if isinstance(
+ self.ids = [self.ids]
+if self.ids and len(self.ids) < self.limit:
Bye
description: | updated |
description: | updated |
description: | updated |
Hello GEM,
First of all latest 6.1 is released and we have already developed a new web client for 6.1.
Our bug management policy are mainly for trunk version as well as bocking point of stable which is the generic way.
I have checked your issue and this type of code(customised) not in official addons. So we can not consider this issue as a generic way.
So would you please try with latest 6.1.
For these type of issues of v6, If you have a support and maintenance contact with us then you can conact our OPW team at <email address hidden>.
Thanks for understanding!