'Update the translations of records.
:param name: a string defined as "<model_name>,<field_name>"
:param tt: the type of translation (should always be "model")
:param lang: the language code
:param ids: the ids of the given records
:param value: the value of the translation
:param src: the source of the translation'

@api.model
def _set_ids(self, name, tt, lang, ids, value, src=None):

    self._modified_model(name.split(',')[0])
    self._cr.execute('UPDATE    ir_translation\n                                                                                                                SET    value=%s,    src=%s,    state=%s\n                                                                                                                WHERE    lang=%s    AND    type=%s    AND    name=%s    AND    res_id    IN    %s\n                                                                                                                RETURNING    res_id', (value, src, 'translated', lang, tt, name, tuple(ids)))
    existing_ids = [row[0] for row in self._cr.fetchall()]
    for res_id in (set(ids) - set(existing_ids)):
        self.create({'lang': lang, 'type': tt, 'name': name, 'res_id': res_id, 'value': value, 'src': src, 'state': 'translated'})
    return len(ids)
