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

hi,

I want to add an image field in quotes (for sale).

please help me

thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi Ibrahim, What version of Odoo are you running?

Tác giả

version 7

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

Hello,

Good question. I presume you know how to inherit a module if not let me know.

This way you can add a image. you can find an example of this in the res_partner module.

inherit the module, add a binary field:

_columns = {'image': fields.binary("Image",
            help="helptext"),
            'image_preview': fields.binary("Preview Image",
            help="helptext"),}

in the view-xml you can add a widget:

 <field name="image" widget='image''/>

there are some options possible like preview_image, size, maybe more, but i don't know all of them.

eg:  <field name="image" widget='image'' options='{"size": [90, 90], "preview_image":"image_preview"}'/>

That should do it.

Have fun.

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

Is it really possible to put picture in a quotation in odoo v8 with this method? Somebody can show me a screenshot? I don't believe you if I don't see it! :)

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

You could easily add the required fields via the GUI by first editing the model and adding a binary field to the product.product or product.template model. You would then need to update the corresponding view for the product by adding an image widget and finaly edit the sale.order RML report.

There are multiple tutorials on this or similar procedures laying around. I could point a few out if you need.

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