fix(fusion_clock): settings audit — remove 2 dead knobs, make IP-fallback + all Boolean toggles work

Audit of all 41 settings found 3 that were shown but read nowhere, and 17 Boolean
toggles that couldn't be turned OFF.

- Remove grace_period_minutes (orphaned by the schedule-driven cron rewrite) and
  weekly_overtime_threshold (never implemented): field + view + seed.
- enable_ip_fallback now actually gates _verify_location's IP-whitelist check
  (default ON to preserve current behaviour).
- All 17 fusion_clock Boolean settings now persist explicitly as 'True'/'False'
  via a _FCLK_BOOL_PARAMS loop in get_values/set_values (config_parameter Booleans
  can't store False, so OFF never stuck). Add round-trip tests. Bump 3.15.2 -> 3.16.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-31 11:51:40 -04:00
parent 31098c4d14
commit d6d6bbe161
8 changed files with 88 additions and 58 deletions

View File

@@ -74,9 +74,11 @@ class FusionClockAPI(http.Controller):
if dist < nearest_distance:
nearest_distance = dist
# IP fallback -- try when GPS is unavailable OR GPS is outside all geofences
# IP fallback -- only when enabled (default on); try when GPS is
# unavailable OR GPS is outside all geofences.
ICP = request.env['ir.config_parameter'].sudo()
if client_ip:
ip_fallback_enabled = ICP.get_param('fusion_clock.enable_ip_fallback', 'True') == 'True'
if client_ip and ip_fallback_enabled:
for loc in locations:
if loc.check_ip_whitelist(client_ip):
return loc, 0, None, 'ip'