This question has been flagged


I want to show multiple images with many2many_binary widget but after saving the selected images, only links of the images are displayed not images. Why? What should I do to show images? Here is my code:-

py code:-

    class image_multi(models.Model):
    _inherit = "product.template"

    image_med = fields.Many2many('ir.attachment', attachment=True, string="Add images")

xml code:-

   <?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="product_image_multi_form" model="ir.ui.view">
            <field name="name">product.imagemulti.form</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">




                <notebook position="inside">
                    <page string="Images" >
                        <group>
                            <field name="image_med" widget="many2many_binary"/>
                        </group>
                    </page>
                </notebook>
            </field>
        </record>
    </data>
</openerp>
   Can anyone help me on this?
Avatar
Discard