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.

20 lines
716 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import api, SUPERUSER_ID
  5. def post_init_hook(cr, registry):
  6. """Loaded after installing the module.
  7. ``ir.exports.line.name`` was before a char field, and now it is a computed
  8. char field with stored values. We have to inverse it to avoid database
  9. inconsistencies.
  10. """
  11. with api.Environment.manage():
  12. env = api.Environment(cr, SUPERUSER_ID, {})
  13. env["ir.exports.line"].search([
  14. ("field1_id", "=", False),
  15. ("export_id", "!=", False),
  16. ("name", "!=", False),
  17. ])._inverse_name()