context = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
values = self.default_get(cr, uid, ['mail_from', 'mail_subject', 'send_mail_existing', 'mail_subject_existing', 'mail', 'partner_ids', 'send_mail'], context)
values['mail_from'] = 'Surveyor'
- new_id = self.create(cr, uid, values)
+ new_id = self.create(cr, uid, values, context)
self.action_send(cr, uid, [new_id], context)
-
I set the value in "Total start survey" field.
survey_obj = self.pool.get('survey')
msg = ""
name = ""
+ survey_id = 0
for sur in survey_obj.browse(cr, uid, context.get('active_ids', []), context=context):
name += "\n --> " + sur.title + "\n"
if sur.state != 'open':
data['mail_subject'] = _("Invitation for %s") % (sur.title)
data['mail_subject_existing'] = _("Invitation for %s") % (sur.title)
data['mail_from'] = sur.responsible_id.email
+ survey_id = sur.id
if msg:
raise osv.except_osv(_('Warning!'), _('The following surveys are not in open state: %s') % msg)
data['mail'] = _('''
self.pool.get('ir.config_parameter').get_param(
cr, uid, 'web.base.url', default='http://localhost:8069',
context=context)
- + '#id=%d&view_type=form&model=survey' % sur.id)
+ + '#id=%d&view_type=form&model=survey' % survey_id)
return data
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False):