Merge lp://staging/~therp-nl/openupgrade-tools/7.0-add-database_cleanup into lp://staging/openupgrade-tools
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~therp-nl/openupgrade-tools/7.0-add-database_cleanup |
Merge into: | lp://staging/openupgrade-tools |
Diff against target: |
1054 lines (+972/-0) 15 files modified
database_cleanup/__init__.py (+1/-0) database_cleanup/__openerp__.py (+55/-0) database_cleanup/model/__init__.py (+6/-0) database_cleanup/model/purge_columns.py (+154/-0) database_cleanup/model/purge_data.py (+106/-0) database_cleanup/model/purge_models.py (+127/-0) database_cleanup/model/purge_modules.py (+91/-0) database_cleanup/model/purge_tables.py (+138/-0) database_cleanup/model/purge_wizard.py (+64/-0) database_cleanup/view/menu.xml (+48/-0) database_cleanup/view/purge_columns.xml (+37/-0) database_cleanup/view/purge_data.xml (+37/-0) database_cleanup/view/purge_models.xml (+36/-0) database_cleanup/view/purge_modules.xml (+36/-0) database_cleanup/view/purge_tables.xml (+36/-0) |
To merge this branch: | bzr merge lp://staging/~therp-nl/openupgrade-tools/7.0-add-database_cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Pedro Manuel Baeza | code review and test | Needs Fixing | |
Review via email: mp+203633@code.staging.launchpad.net |
Description of the change
Partial implementation of https:/
This proposal adds a module to clean up after a homebrew migration process such as OpenUpgrade.
Unmerged revisions
- 14. By Stefan Rijnhart (Opener)
-
[RFR] Flake8
- 13. By Stefan Rijnhart (Opener)
-
[FIX] Label
[FIX] Catch attempt to unlink field from nonexisting model - 12. By Stefan Rijnhart (Opener)
-
[IMP] Docstrings
- 11. By Stefan Rijnhart (Opener)
-
[FIX] Data purging now working
- 10. By Stefan Rijnhart (Opener)
-
[ADD] Allow purging of dangling data entries
- 9. By Stefan Rijnhart (Opener)
-
[RFR] Group models per table when detecting columns to purge
to prevent problems with models sharing the same table - 8. By Stefan Rijnhart (Opener)
-
[FIX] Preserve dangling workflow table which is in use
- 7. By Stefan Rijnhart (Opener)
-
[FIX] Don't remove uid field from wkf_instance, which is written in
raw SQL query (but never read afterwards). Workaround for
lp:1277899 - 6. By Guewen Baconnier @ Camptocamp
-
[FIX] error in previous merge
- 5. By Guewen Baconnier @ Camptocamp
-
[IMP] Remove the fields having a relation to the purged models.
Hi Stefan,
Thanks for this handy module!
I had an error when purging a model having attachments (poweremail. mailbox) . Not sure if this issue lies in the ir.attachment code or the purge though.
In openerp/ addons/ base/ir/ ir_attachment. py the method check() calls exists on the deleted model.
mids = self.pool. get(model) .exists( cr, uid, mids)
ima. check(cr, uid, model, mode)
self. pool.get( model). check_access_ rule(cr, uid, mids, mode, context=context)
Maybe should the purge delete the attachments or drop the relationship beforehand?
Traceback (most recent call last): gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ netsvc. py", line 292, in dispatch_rpc getService( service_ name).dispatch( method, params) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ service/ web_services. py", line 626, in dispatch gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ osv/osv. py", line 190, in execute_kw gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ osv/osv. py", line 132, in wrapper gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ osv/osv. py", line 199, in execute gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ osv/osv. py", line 187, in execute_cr gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/openupgra de-tools/ database_ cleanup/ model/purge_ wizard. py", line 58, in purge_all context) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/openupgra de-tools/ database_ cleanup/ model/purge_ models. py", line 73, in purge context) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/addons/ base_calendar/ crm_meeting. py", line 160, in write attachment, self).write(cr, uid, ids, vals, context=context) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/addons/ document/ document. py", line 137, in write file, self).write(cr, uid, ids, vals, context) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ addons/ base/ir/ ir_attachment. py", line 277, in write gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/addons/ document/ document. py", line 77, in check document_ file, self).check(cr, uid, ids, mode, context=context, values=values) gbaconnier/ code/instances/ openerp_ foobar/ trunk7/ parts/server/ openerp/ addons/ base/ir/ ir_attachment. py", line 211, in check get(model) .exists( cr, uid, mids)
File "/home/
result = ExportService.
File "/home/
res = fn(db, uid, *params)
File "/home/
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
context=
File "/home/
context=
File "/home/
return super(ir_
File "/home/
return super(document_
File "/home/
self.check(cr, uid, ids, 'write', context=context, values=vals)
File "/home/
super(
File "/home/
mids = self.pool.
AttributeError: 'NoneType' object has no attribute 'exists'