post-migration.py 490 B

123456789101112
  1. from odoo import api, SUPERUSER_ID
  2. def migrate(cr, version):
  3. env = api.Environment(cr, SUPERUSER_ID, {})
  4. # Use SQL to bypass "Properties of base fields cannot be altered" ORM check
  5. cr.execute("""
  6. UPDATE ir_model_fields
  7. SET website_form_blacklisted = false
  8. WHERE model = 'helpdesk.ticket' AND name = 'attachment_ids'
  9. """)
  10. # Also for good measure, check if we need to do it for 'helpdesk.ticket' specifically?
  11. # The WHERE clause handles it.