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.

19 lines
692 B

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