survey.py 800 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo.addons.survey.controllers import main
  4. class Survey(main.Survey):
  5. def _prepare_survey_finished_values(self, survey, answer, token=False):
  6. result = super(Survey, self)._prepare_survey_finished_values(survey, answer, token)
  7. if answer.slide_id:
  8. result['channel_id'] = answer.slide_id.channel_id
  9. return result
  10. def _prepare_retry_additional_values(self, answer):
  11. result = super(Survey, self)._prepare_retry_additional_values(answer)
  12. if answer.slide_id:
  13. result['slide_id'] = answer.slide_id.id
  14. if answer.slide_partner_id:
  15. result['slide_partner_id'] = answer.slide_partner_id.id
  16. return result