I want to bring the following custom functionality to my CRM.
I have created a new model called crm.presales.value, which has
lead_id = fields.Many2one('crm.lead', string="Opportunity")
user_id = fields.Many2one('res.users', string="User")
team_id = fields.Many2one('crm.team', string='Presales Team')
value = fields.Float()among other fields and functions.
I have inherited the crm.lead model to include
presales_ids = fields.One2many('crm.presales.value', 'lead_id', string="Presales")
presales_team_ids = fields.Many2many('crm.team', string="Presales Teams", compute='_compute_presales_team_ids', store=True)
In my crm.lead form view,
- I want checkboxes to select presales teams.
- When a team is selected, I want a separate inline list view to appear (for each team), which allows me to add the user and other required info.
- When saving the form, if any list is empty I want that team to be unchecked.
How can I implement this dynamically? (using xml or qweb templates)
Odoo v18 Community edition