Skip to content

Instantly share code, notes, and snippets.

@SButko
Forked from oerp-odoo/recompute_odoo_field.py
Created August 10, 2018 20:17
Show Gist options
  • Save SButko/0791d2e61e0c7a8724c9e6eb82a80690 to your computer and use it in GitHub Desktop.
Save SButko/0791d2e61e0c7a8724c9e6eb82a80690 to your computer and use it in GitHub Desktop.
Recompute Odoo field from shell
# python3 odoo-bin shell -c odoo.conf -d <database>
model = env['some.model']
env.add_todo(model._fields['field_name'], model.search([]))
model.recompute()
env.cr.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment