You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
467 B

  1. # -*- coding: utf-8 -*-
  2. # © 2017 Therp BV <http://therp.nl>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import api, SUPERUSER_ID
  5. def post_init_hook(cr, registry):
  6. env = api.Environment(cr, SUPERUSER_ID, {})
  7. partner_model = env['res.partner']
  8. # get all fields with a parent
  9. partners = partner_model.with_context(active_test=False).search(
  10. [('parent_id', '!=', False)]
  11. )
  12. partners.update_relations()