Upgrade to 5.2 : ir_rule_group is null

records are unsync. you should resync them.

using gui: Administration > Model > Model > Data , select all unsync records and run “resync” action

using trytond-console:

  $ trytond-console -c config.ini -d ${DBNAME}
  >>> Data = pool.get('ir.model.data')
  >>> ms = Data.search([('out_of_sync', '=', True)])
  >>> Data.sync(ms)
  >>> transaction.commit()

Usually after a resync, you want to rerun trytond-admin update step (and check again that no more unsync records are present).