| 123456789101112131415161718192021 |
- # -*- coding: utf-8 -*-
- from . import controllers
- from . import models
- from . import wizard
- from odoo import api, SUPERUSER_ID
- def post_init_hook(env):
- """
- Hook to whitelist attachment_ids for helpdesk.ticket in website forms.
- This runs after module installation/update.
- """
- # Use SQL to bypass "Properties of base fields cannot be altered" ORM check
- env.cr.execute("""
- UPDATE ir_model_fields
- SET website_form_blacklisted = false
- WHERE model = 'helpdesk.ticket' AND name = 'attachment_ids'
- """)
- # Verify if it was updated (optional, but good for debugging)
- # env.cr.commit() # Not strictly needed as post_init_hook runs in transaction? Odoo handles commit.
|