Xml 如何在Openerp向导中编辑检索到的向导应答
我第一次碰巧遇到了这个Openerp向导,而且我知道一旦你点击“完成”按钮,你就不能编辑你保存的内容。 我需要做的是在检索向导后,使其在某些状态下可编辑 以下是我对该向导的调用,请帮助我使其可编辑 xml调用Xml 如何在Openerp向导中编辑检索到的向导应答,xml,python-2.7,openerp,openerp-7,Xml,Python 2.7,Openerp,Openerp 7,我第一次碰巧遇到了这个Openerp向导,而且我知道一旦你点击“完成”按钮,你就不能编辑你保存的内容。 我需要做的是在检索向导后,使其在某些状态下可编辑 以下是我对该向导的调用,请帮助我使其可编辑 xml调用 <button name="action_call_questions" string="Start" type="object" class="oe_highlight"/> def action_call_questions(self, cr, uid, ids, c
<button name="action_call_questions" string="Start" type="object" class="oe_highlight"/>
def action_call_questions(self, cr, uid, ids, context=None):
"""
Open Browse Response wizard. if you select only survey_id then this wizard open with all response_ids and
if you select survey_id and response_id then open the particular response of the survey.
"""
if context is None: context = {}
record = self.read(cr, uid, ids, [])
record = record and record[0] or {}
if record['response_id']:
res_id = [(record.get('response_id') and record['response_id'][0])]
else:
sur_response_obj = self.pool.get('survey.response')
res_id = sur_response_obj.search(cr, uid, [('survey_id', '=', record['survey_id'][0])])
context.update({'active' : True,'survey_id' : record['survey_id'][0], 'response_id' : res_id, 'response_no' : 0})
search_obj = self.pool.get('ir.ui.view')
search_id = search_obj.search(cr,uid,[('model','=','survey.question.wiz'),('name','=','Survey Search')])
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'survey.question.wiz',
'type': 'ir.actions.act_window',
'target': 'new',
'search_view_id':search_id[0],
'context' : context
}