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 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 gotten the structure. But now, its not showing my existing product but want me to create new one which I dont want. I want to select my existing product. If I need to create one, i will do it in product.product model as usual rule. Can anyone suggest me what I need to do?
here my code:
.py:
from odoo import models, fields, api
class CrmLead(models.Model):
_inherit = 'crm.lead'
product_ids = fields.One2many('product.product', 'crm_lead_id', string='Products')
class ProductProduct(models.Model):
_inherit = 'product.product'
crm_lead_id = fields.Many2one('crm.lead', string='CRM Lead')
product_image = fields.Binary(string='Product Image')
.xml:
techtrioz.crm.lead.form.inherit
crm.lead
Any suggestion, what to do?
Any suggestion, what to do?