在 v8 中,我们将 wizard.survey_id 作为“survey.survey”对象,而不是 id。因此,重写 _get_public_url 函数,如下所示:
def _get_public_url(self, cr, uid, ids, name, arg, context=None):
res = dict((id, 0) for id in ids)
survey_obj = self.pool.get('survey.survey')
for wizard in self.browse(cr, uid, ids, context=context):
if isinstance(wizard.survey_id,int):
res[wizard.id] = survey_obj.browse(cr, uid, wizard.survey_id, context=context).public_url
else:
res[wizard.id] = wizard.survey_id.public_url
return res
通过邮件共享和邀请时,选择“向您的听众发送私人邀请(每个收件人和每个邀请只有一个回复)”选项,以便它为每个联系人发送一个唯一链接,您可以在答案中看到这些链接的令牌。
还有一件事,除非 Odoo 服务器以 db-filter 选项启动(如果存在多个数据库),否则这些链接将不起作用。因为,这些链接的数据库名称不存在。因此,如果我们单击这些生成的链接,它会返回一个错误,例如“此网页不可用”。