Tardo / OdooTerminal

Webextension tool for Odoo
GNU Affero General Public License v3.0
119 stars 27 forks source link

Batch unlink #92

Closed wai closed 1 year ago

wai commented 1 year ago

I want to mass unlink some records after searching, and I found here already have some great syntax.

  1. Search and return the recordsets
  2. Subcommands to use the result in a new command call

So it would be great if I can use the below syntax to unlink records.

unlink -m ir.attachment -i {{search -m ir.attachment -f id -d [['res_model','=','ir.ui.view'],['name','like','assets_']]}}.id

Thanks for the great tools. I hope I hadn't missed anything in the doc.

Tardo commented 1 year ago

Hi! currently you can do it with:

$records = $(search -m ir.attachment -f id -d [['res_model','=','ir.ui.view'],['name','like','assets_']])
unlink -m ir.attachment -i $records['id']

I expect to upload an update this weekend so that it can be operated directly (It is a bug that it is not currently working in this way): unlink -m ir.attachment -i $(search -m ir.attachment -f id -d [['res_model','=','ir.ui.view'],['name','like','assets_']])['id']

wai commented 1 year ago

That is awesome! Thanks @Tardo 🎉🎉🎉