Hello All,
I getting this error while applying function in Odoov10.
TypeError: unsupported operand type(s) for +: 'bool' and 'str'.
**My Python code is here:**
@api.multi
def name_get(self):
result = []
print "re:", result
for record in self:
print "R:", record
name = '[' + record.pet_name + ']' + ' ' + record.name
result.append((record.id, name))
return result
here the type of the record will be of unicode, change it to str and do the operation
Hello Niyas,
I getting wrong value for this fucntion instead of 'pet_name' i getting 'patner_id(customer name)'. Can you provide me exact solution for this problem?
Hello NIyas,
Now, My function work well. But, Can u tell me how to call this function for particular class only, not global. My class name is "body_processing" where i want to call this 'name_get' function. My code is here:
@api.multi
def name_get(self):
result = []
for record in self:
name = '['
if record.pet_name:
name += record.pet_name + ']' + ' ' + record.name
else:
name += '] ' + record.name
result.append((record.id, name))
return result