Holger Brunn
7 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
15 changed files with 27 additions and 113 deletions
-
2database_cleanup/__manifest__.py
-
4database_cleanup/identifier_adapter.py
-
1database_cleanup/models/__init__.py
-
17database_cleanup/models/ir_model_fields.py
-
2database_cleanup/models/purge_columns.py
-
3database_cleanup/models/purge_tables.py
-
10database_cleanup/tests/test_database_cleanup.py
-
11database_cleanup/views/create_indexes.xml
-
13database_cleanup/views/purge_columns.xml
-
13database_cleanup/views/purge_data.xml
-
13database_cleanup/views/purge_menus.xml
-
13database_cleanup/views/purge_models.xml
-
13database_cleanup/views/purge_modules.xml
-
12database_cleanup/views/purge_properties.xml
-
13database_cleanup/views/purge_tables.xml
@ -1,17 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# © 2014-2016 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from openerp import api, models |
|||
|
|||
|
|||
class IrModelFields(models.Model): |
|||
_inherit = 'ir.model.fields' |
|||
|
|||
# In case of purging it means the model does not exist anymore in |
|||
# installed module. In this specific case, we need to avoid to check |
|||
# if fields can be removed as it would fail. |
|||
@api.multi |
|||
def _prepare_update(self): |
|||
if self.env.context.get('purge'): |
|||
self -= self.filtered(lambda x: x.model not in self.env.registry) |
|||
return super(IrModelFields, self)._prepare_update() |
Write
Preview
Loading…
Cancel
Save
Reference in new issue