如何在 'ir.actions.act_url'
内循环 multipe return for
。
这是我的模块:
@api.multi
def export_multi_worksheets(self):
...
for j, row_emp in enumerate(list_emp):
...
workbook.close()
return {
'type': 'ir.actions.act_url',
'target': 'self',
'url': '{}web/binary/worksheet_export/report?file_format=xlsx&file_name={}'.format(http.request.httprequest.host_url, file_name)
}
这是我的看法:
<record id="hr_worksheet_multi_export_action" model="ir.actions.server">
<field name="name">Export Batch</field>
<field name="model_id" ref="ess.model_hr_ess_worksheet"/>
<field name="binding_model_id" ref="ess.model_hr_ess_worksheet"/>
<field name="state">code</field>
<field name="code">
action = self.export_multi_worksheets(cr, uid, context['active_ids'], context=context)
</field>
<field eval="True" name="condition"/>
</record>
在第一次返回第二行的非循环之后。这种情况如何循环导出多个文件?