I have added a page inside crm which contains 2 fields: product info and image.Whenever I try to select a product, another new page pop up and it want me to select from there.But I want select it inline option. I have tried many ways but nothing worked. What I need to do?
Here is my code:
.py:
from odoo import models, fields, api
class CrmLead(models.Model):
_inherit = 'crm.lead'
product_ids = fields.many2many('product.product', string='Products', edit="inline")
combined_info = fields.Char(string='Product Info', compute='_compute_combined_info')
def _compute_combined_info(self):
for product in self:
product.combined_info = f"{product.default_code} - {product.name}"
class ProductImage(models.Model):
_inherit = 'product.product'
_description = 'Product Image'
product_image = fields.Binary(string='Design')
combined_info = fields.Char(string='Product Info', compute='_compute_combined_info')
def _compute_combined_info(self):
for product in self:
product.combined_info = f"{product.default_code} - {product.name}"
.xml:
wise.crm.lead.form.inherit
crm.lead