How do you add values to a field in multiple selected records from a list/tree view?
I'm pretty new to Odoo and Python in general and am trying to add a mod to our helpdesk. We built a wizard to set up a form to add an IT tech to multiple tickets at once. I know I should use context.get('active_ids') so I can go through all the selected tickets, but I'm having issues getting it to work. Any advice would be appreciated
helpdesks_ids = fields.Many2many('helpdesk.ticket')
user_ids = fields.Many2many('res.users', string="IT Technicians", required=True)
def action_assign_tech(self, vals):
t = self.env['helpdesk.ticket'].browse(self._context.get('active_ids'))
for ticket in self.helpdesks_ids:
t.user_id = ticket.user_id