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): File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, *params) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, **kw or {}) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, *args, **kwargs) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/openupgrade-tools/database_cleanup/model/purge_wizard.py", line 58, in purge_all context=context) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/openupgrade-tools/database_cleanup/model/purge_models.py", line 73, in purge context=context) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/addons/base_calendar/crm_meeting.py", line 160, in write return super(ir_attachment, self).write(cr, uid, ids, vals, context=context) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/addons/document/document.py", line 137, in write return super(document_file, self).write(cr, uid, ids, vals, context) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/addons/base/ir/ir_attachment.py", line 277, in write self.check(cr, uid, ids, 'write', context=context, values=vals) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/addons/document/document.py", line 77, in check super(document_file, self).check(cr, uid, ids, mode, context=context, values=values) File "/home/gbaconnier/code/instances/openerp_foobar/trunk7/parts/server/openerp/addons/base/ir/ir_attachment.py", line 211, in check mids = self.pool.get(model).exists(cr, uid, mids) AttributeError: 'NoneType' object has no attribute 'exists'
« Back to merge proposal
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'