تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1132 أدوات العرض

Hello everyone,


I'm a new developer who started using odoo a while ago

I'm currently working on simplifying the URLs of product images on my website.

Issue:

When I export product images, the URLs are quite complex and include multiple query strings. For example:


​img class="img img-fluid mx-auto o_img_product_square" loading="lazy" src="/web/image/product.product/86/image_512?unique=f864873" alt="product"



Desired Outcome:

I would like to simplify the URLs to a more readable format, such as:


img class="img img-fluid mx-auto o_img_product_square" loading="lazy" src="/web/image/product/image_f864873.png" alt="product"



Could anyone guide me on how to achieve this in Odoo? Any help or pointers would be greatly appreciated!


Thank you very much,


Tinh Nguyen


الصورة الرمزية
إهمال
أفضل إجابة

I know this is a little old, but how do export the Image URLs?

الصورة الرمزية
إهمال
أفضل إجابة

Hello Tinh Nguyen

similar to base code, you can define route for your desired url and write logic to search file and retun based on request.

@http.route(['/web/image/product/'])
def product_image(self,...

Base cor for your reference


Thanks & Regards,


CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209

Email: info@candidroot.com

الصورة الرمزية
إهمال
الكاتب

Hi CandidRoot Solutions Private Limited

Thank you for your feedback

I will try your solution.

Have a good day.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 25
424
0
نوفمبر 24
1209
0
أكتوبر 24
1438
1
أكتوبر 24
2091
0
أكتوبر 24
1247