Files
Odoo-Modules/fusion-plating/fusion_tasks/__init__.py
gsinghpal 10607c48f0 refactor(fusion_tasks): update deps, config, crons for delivery context
- Change depends to [base, mail, hr, fusion_plating_logistics]
- Rename module to 'Fusion Plating -- Delivery Tasks'
- Replace all fusion_claims.* config params with fusion_tasks.*
- Remove sync crons (pull_remote_tasks, cleanup_old_shadows)
- Remove sync config ACL lines from ir.model.access.csv
- Replace sales_team group refs with hr/base equivalents
- Update license from OPL-1 to LGPL-3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:28:38 -04:00

36 lines
1.3 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2024-2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
from . import models
def _fusion_tasks_post_init(env):
"""Post-install hook for fusion_tasks.
1. Sets default ICP values (upsert - safe if keys already exist).
2. Adds all active internal users to group_field_technician so
the Field Service menus are visible immediately after install.
"""
ICP = env['ir.config_parameter'].sudo()
defaults = {
'fusion_tasks.google_maps_api_key': '',
'fusion_tasks.store_open_hour': '9.0',
'fusion_tasks.store_close_hour': '18.0',
'fusion_tasks.push_enabled': 'False',
'fusion_tasks.push_advance_minutes': '30',
'fusion_tasks.technician_start_address': '',
}
for key, default_value in defaults.items():
if not ICP.get_param(key):
ICP.set_param(key, default_value)
# Add all active internal users to Field Technician group
ft_group = env.ref('fusion_tasks.group_field_technician', raise_if_not_found=False)
if ft_group:
internal_users = env['res.users'].search([
('active', '=', True),
('share', '=', False),
])
ft_group.write({'user_ids': [(4, u.id) for u in internal_users]})