Hello,
I have 2 models A and B.
When i update field_1 on A model i execute a function that should add a new record into B model.
How can i do this?
I read that we can execute SQL request (example belaw) but maybe there is an other way more clean than do an INSERT to add new record?
query = """ SELECT event_id, state, sum(nb_register)
FROM event_registration
WHERE event_id IN %s AND state IN ('draft', 'open', 'done')
GROUP BY event_id, state """
self._cr.execute(query, (tuple(self.ids),))
Thanks,
Sebastian