diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-05-06 06:26:20 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-05-06 06:26:20 +0000 |
| commit | e2e4b16751a23f591f9d331c47bca5d28e2dd250 (patch) | |
| tree | 70f07cf90dd31e760b3f82ec6ed1b37ee4344e7c /odoo/models.py | |
| parent | 396adbbb7cceb25696d2f73573448fbe3034835d (diff) | |
[REV] models: revert ba58888ce as better fix
This reverts the saas-12.2 commit as 112bd835d80619a was merged in 12.0 and
now is forward ported.
The uninstallation is the only reason it is really problematic to keep
translations (as the id are reset after reinstall).
ba58888ce was slower
closes odoo/odoo#33169
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'odoo/models.py')
| -rw-r--r-- | odoo/models.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/odoo/models.py b/odoo/models.py index 7ccd75a777f..0a0d8147549 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -3165,7 +3165,6 @@ Fields: Data = self.env['ir.model.data'].sudo().with_context({}) Defaults = self.env['ir.default'].sudo() Attachment = self.env['ir.attachment'] - Translation = self.env['ir.translation'].sudo() for sub_ids in cr.split_for_in_conditions(self.ids): query = "DELETE FROM %s WHERE id IN %%s" % self._table @@ -3196,15 +3195,6 @@ Fields: if attachments: attachments.unlink() - if any(field.translate for field in self._fields.values()): - # For the same reason, remove the relevant records in ir_translation - translations = Translation.search([ - ('type', 'in', ['model', 'model_terms']), - ('name', '=like', self._name+',%'), - ('res_id', 'in', sub_ids)]) - if translations: - translations.unlink() - # invalidate the *whole* cache, since the orm does not handle all # changes made in the database, like cascading delete! self.invalidate_cache() |
