Skip to content

Instantly share code, notes, and snippets.

@mao-odoo
Last active January 22, 2025 10:48
Show Gist options
  • Save mao-odoo/c554c59117a4df64f7a49a3330a94d28 to your computer and use it in GitHub Desktop.
Save mao-odoo/c554c59117a4df64f7a49a3330a94d28 to your computer and use it in GitHub Desktop.
Get a list of the neutralisations that will be applied by the standard odoo neutralisation for a local database
path_to_odoo_code=<The_path_to_the_odoo_code>
db_name=<The_name_of_the_database>
neutered_apps=$(find $path_to_odoo_code -name neutralize.sql | jq -nRr '[inputs] | map(split("/")[-3]) | join(",")');
for module in $(psql -tAqX -d $db_name -c "select name from ir_module_module where name = ANY('{$neutered_apps}'::text[]) and state not in ('uninstalled', 'uninstallable') order by name;"); do
echo "\n\n----- $module -----";
cat $(find $path_to_odoo_code/**/$module/data/neutralize.sql);
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment