Skip to content

Instantly share code, notes, and snippets.

@cmorisse
Forked from andrius-preimantas/ir.actions.server.py
Created August 9, 2019 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmorisse/bb74f55d3347d30301cf25461f8d3a49 to your computer and use it in GitHub Desktop.
Save cmorisse/bb74f55d3347d30301cf25461f8d3a49 to your computer and use it in GitHub Desktop.
Odoo server action to recompute stored fields
# Recompute amount_total for account.invoice
env.add_todo(model._fields['amount_total'], object)
model.recompute()
# where
# object - recordset of instances to recompute field for
# model - recordset instances model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment