Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1267 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 24
55
0
เม.ย. 24
2146
0
พ.ย. 23
1801
1
ส.ค. 23
4925
1
มิ.ย. 23
3719