Here is my situation:
I have a page inside notebook which is "Product Info". Inside this page, I have added two fields : product_id, product_image. So whenever I select a product, it will automatically show relevant image of that product. I have done this with this code:
from odoo import models, fields, api
class CrmLead(models.Model):
_inherit = 'crm.lead'
product_id = fields.Many2one('product.product', string="Product")
product_image = fields.Binary(string='Custom Design',related='product_id.product_image', store=True)
class ProductImage(models.Model):
_inherit = 'product.product'
_description = 'Product Image'
product_image = fields.Binary(string='Custom Design')
But now, I want to this product_id field as a one2many relation type with product.product alongside with product_image and attachment file field similar like order_line so that I can select as much product as I want . I have tried several ways but went in vein. So what I need to do to achieve that requirement?