Skip to content
Snippets Groups Projects
Commit 09ea5c7d authored by Tanguy Charlier's avatar Tanguy Charlier Committed by Jérome Maes
Browse files

[IMP] survey: add gc of empty survey userinputs in the autovacuum cron

parent 66cb880b
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,6 @@ sent mails with personal token for the invitation of the survey.
'views/survey_result.xml',
'wizard/survey_email_compose_message.xml',
'data/survey_stages.xml',
'data/survey_cron.xml'
],
'demo': ['data/survey_demo_user.xml',
'data/survey_demo_feedback.xml',
......
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!-- Remove unused user inputs -->
<record forcecreate="True" id="ir_cron_clean_empty_surveys"
model="ir.cron">
<field name="name">Run Clean empty surveys</field>
<field name="active" eval="True"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model" eval="'survey.user_input'"/>
<field name="function" eval="'do_clean_emptys'"/>
<field name="args" eval="'()'"/>
</record>
</data>
</openerp>
......@@ -2,3 +2,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import survey
import ir_autovacuum
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class AutoVacuum(models.AbstractModel):
_inherit = 'ir.autovacuum'
@api.model
def power_on(self, *args, **kwargs):
self.env['survey.user_input'].do_clean_emptys()
return super(AutoVacuum, self).power_on(*args, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment