[FIX] portal: avoid errors during autovacuum
authorMartin Trigaux <mat@openerp.com>
Mon, 7 Jul 2014 15:12:27 +0000 (17:12 +0200)
committerMartin Trigaux <mat@openerp.com>
Mon, 7 Jul 2014 15:12:27 +0000 (17:12 +0200)
When the cron for autovacuum runs, the osv_memory objects are deleted. The portal.wizard.user object has a required field (wizard_id) linked to another osv_memory object (portal.user) which causes a traceback when the cron tries to delete portal.user object before the portal.wizard.user. opw 609918

addons/portal/wizard/portal_wizard.py

index fb46533..0f9ad7a 100644 (file)
@@ -116,7 +116,7 @@ class wizard_user(osv.osv_memory):
     _description = 'Portal User Config'
 
     _columns = {
-        'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True),
+        'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete="cascade"),
         'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
         'email': fields.char(size=240, string='Email'),
         'in_portal': fields.boolean('In Portal'),