和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
雖然分享,並通過郵件邀請中選擇「發送私人邀請你的觀衆(每個收件人和每個邀請只有一個響應)」選項,這樣,它發出了一個獨特的鏈接每個聯繫人,你可以在Answers中看到這些鏈接的標記。
還有一件事,除非Odoo服務器以db-filter選項啓動(如果存在多個數據庫),否則這些鏈接將不起作用。因爲,這些鏈接數據庫名稱不存在。所以,如果我們點擊這些生成的鏈接,它會返回一個錯誤,如「此網頁不可用」。
您使用開發者版本嗎? – BomberMan 2014-10-11 14:19:34
我在這個鏈接中找到它https://www.odoo.com/page/download – 2014-10-13 07:07:32