如何在Openerp向导中编辑检索到的向导答案

时间:2017-11-06 11:20:19

标签: xml python-2.7 openerp openerp-7

我第一次碰到了这个Openerp向导,而且一旦你点击" Done"我就知道了。按钮,您无法编辑已保存的内容。 我需要做的是,一旦你找回它,就可以为某些状态编辑该向导。

以下是我对向导的要求,请帮助我使其可编辑。

xml通话

 <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
         }

0 个答案:

没有答案