Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
26659 Lượt xem

Hi ! 


I'm modifying the Product Labels view in Odoo V.0. I'd like to insert pictures linked to the activation of new fields I've created.

Can you tell me where the images are stored so I can refer to this URL or something else in my view ?

Thanks !


Ảnh đại diện
Huỷ bỏ

product images stored in DB as Binary and you can find it in image_medium field under Product.Template model

Hi Waleed ! 

Thanks for your reply ! 
My question is not clear. It's not about product image but about other images like the one attached, linked to a new field I've created.
Example : my field is "Organic" 
If "Organic" is true, then the image attached will appear on my label.
So I need to be able to store this image on my DB and then to refer to it so I can write something like...
<t t-if="product.organic">
    <img ... > </img>
</t>



Picto_Feuille_BIO.jpg

Le lun. 22 janv. 2018 à 18:03, Waleed Mohsen <mohsen.waleed@gmail.com> a écrit :

product images stored in DB as Binary and you can find it in image_medium field under Product.Template model

--
Waleed Mohsen


Sent by Odoo S.A. using Odoo.

try this

Store it in your module folder under static/src/img and you reference it from XML

<img src='/module name/static/src/img/image_name />

Thanks for your answer ! 
I'm sorry... I'm a real beginner.
Can you tell me how to access ir_attachments so I can upload images and then reference them in my Product Label view ?

Le lun. 22 janv. 2018 à 19:42, Hilar <hilarak@gmail.com> a écrit :

A new answer on Where are stored the images ? has been posted. Click here to access the post :

See post



Sent by Odoo S.A. using Odoo.

Câu trả lời hay nhất

All attachments in odoo are stored under the table ir_attachments. Here odoo stores the res_model, res_id, its binary data, then the file type and so on.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
706
1
thg 4 24
1211
0
thg 10 23
908
0
thg 3 23
1287
0
thg 1 25
2074