I have an onchange function to update two fields on2many, when the function is executed odoo is deleting the records that related to them from database, here is my code:
@api.onchange('ticket_type_id')
def set_ticket_type_id(self):
if self.ticket_type_id and self.ticket_type_id.product_ids:
self.write({'product_ids':[(6, 0, self.ticket_type_id.product_ids.ids)]})
if self.ticket_type_id and self.ticket_type_id.keywords_ids:
self.keyword_ids = self.ticket_type_id.keywords_ids
and here is the messages from the log :
odoo.models.unlink: User #2 deleted product.template records with IDs: [43]
odoo.models.unlink: User #2 deleted helpdesk.keywords records with IDs: [3]
Am I missing something !!
Note: Odoo13