hello, I am trying to send custom values to a many2many field in mail template, however, it shows the following error "raise ValueError("Wrong value for %s: %s" % (self, value))"
My code in model.py is
if latestmessage:
cc =[]
for cclist in latestmessage.cc_recipient_ids:
cc.append(cclist.id)
ctx={
'default_model': 'crm.lead',
'default_res_id': self.ids[0],
'default_use_template': bool(template_id),
'default_template_id': template_id,
'mark_so_as_sent': True,
'default_composition_mode': 'comment',
'force_email': True,
'to':joined_partner,
'cc_recipient_ids':cc,
}
and in template:
${ctx.get('cc_recipient_ids') or 0}
the cc_recipient_ids is the many2many field