I have this action server:
def obtener_todos_los_adjuntos_en_un_zip(self):
tab_id = []
for invoice in self:
tab_id.append(invoice.id)
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
url = f'{base_url}/web/binary/descargar_adjuntos?ids={"-".join(str(x) for x in tab_id)}'
return {
"type": "ir.actions.act_url",
"url": url,
"target": "new",
}
In my xml:
<odoo>
<record id="account_move_action_server"
model="ir.actions.server">
<field name="name">Descargar todos los adjuntos</field>
<field name="model_id"
ref="model_account_move" />
<field name="binding_model_id"
ref="model_account_move" />
<field name="state">code</field>
<field name="code">
if records:
records.obtener_todos_los_adjuntos_en_un_zip()
</field>
</record>
</odoo>
But it is not doing anything with the url passed to it. What do I need to do to make this action.url work?