Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4076 Vizualizări

Hello everyone

I have a form in which we have the possibility to upload images. However when we upload the images they are not displayed. Here is how I declared my field:

image_attachment_ids = fields.Many2many ('ir.attachment', 'ir_attachment_request_rel', 'record_id', 'attachment_id', string = "Image", required = True, attachment = True) 

and on the XML file I did this:



What I want is that the images are displayed when the upload is finished

Imagine profil
Abandonează

Did you find any solution? If yes please share.

No sorry I didn't find a solution.


On Fri, May 13, 2022, 08:53 Golam Mostafa <notifications@mail.odoo.com> wrote:

Did you find any solution? If yes please share.

Sent by Odoo S.A. using Odoo.

Cel mai bun răspuns

 Hey, 

This could help u:

    image_op_ids = fields.Many2many('ir.attachment', string="Images")

In form view:

                        <field name="image_op_ids"  widget="many2many_kanban">                            <kanban quick_create="false" create="true" delete="true">                                <templates>                                    <t-name="kanban-box">                                        <div class="oe_kanban_global_click" style="position: relative">                                            <div class="oe_module_vignette">                                                <field name="datas" widget="image" style="width:50px; height:50px;" class="oe_avatar"/>                                                <field name="description"/>                                                <div class="oe_module_desc">                                                div>                                            div>                                        div>                                    t>                                templates>                            kanban>                        field>
                               

                                      

                                               

                                                       



Imagine profil
Abandonează

it works, even in Odoo 17, tested by me
only that it needs some adjustments for the styling