Skip to Content
Menu
This question has been flagged

Im trying to use odoo product image carousel template to display images, Instead of using product images I'm using string -URLs(which are stored in a field) through img t-att-src tag

Getting error -

AttributeError: 'NoneType' object has no attribute 'isspace'



    

please let me know what's wrong here

Avatar
Discard
Best Answer

The error message AttributeError: 'NoneType' object has no attribute 'isspace' typically means that you’re trying to call a method on a None object. In your case, it seems like the img t-att-src tag is getting a None value instead of a string URL.

Here are a few things you could check:

  1. Ensure the field contains a URL: Make sure the field from which you’re trying to get the URLs actually contains data. If the field is empty for some records, it could lead to this error.
  2. Check for empty strings or None values: If there are any records where the URL field is an empty string or None, this could cause the error. You might want to add a condition to check if the URL is not None or not an empty string before assigning it to img t-att-src.
  3. Debug the template: You can print the value of the URL field in the Odoo log by adding a t-esc in your template like this: . This will print the value in the console when you render the template, and it can help you debug the issue.

Remember, the t-att-src should always receive a string. If it gets None, it will result in an error.


Avatar
Discard
Related Posts Replies Views Activity
0
May 24
55
0
Apr 24
2144
0
Nov 23
1794
1
Aug 23
4904
1
Jun 23
3717