From 31098c4d14adcb8febc37de3e8161b9f0aaac9af Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 31 May 2026 11:30:47 -0400 Subject: [PATCH] fix(fusion_clock): Anchor Date is a real date picker (Date field, manual persist) The Pay Period Anchor Date was a free-text Char. Make it a fields.Date (date picker) persisted manually in get_values/set_values as 'YYYY-MM-DD' under fusion_clock.pay_period_start (res.config.settings Date fields don't round-trip via config_parameter in Odoo 19). Reader code unchanged. Bump 3.15.1 -> 3.15.2. Co-Authored-By: Claude Opus 4.8 --- fusion_clock/__manifest__.py | 2 +- fusion_clock/models/res_config_settings.py | 23 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/fusion_clock/__manifest__.py b/fusion_clock/__manifest__.py index 87ce4175..480787e2 100644 --- a/fusion_clock/__manifest__.py +++ b/fusion_clock/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Fusion Clock', - 'version': '19.0.3.15.1', + 'version': '19.0.3.15.2', 'category': 'Human Resources/Attendances', 'summary': 'Complete Employee T&A with Geofencing, Shifts, Penalties, Overtime, Kiosk, Dashboard & Payroll Export', 'description': """ diff --git a/fusion_clock/models/res_config_settings.py b/fusion_clock/models/res_config_settings.py index 308063f5..490570f2 100644 --- a/fusion_clock/models/res_config_settings.py +++ b/fusion_clock/models/res_config_settings.py @@ -199,10 +199,15 @@ class ResConfigSettings(models.TransientModel): default='biweekly', help="How often attendance reports are generated.", ) - fclk_pay_period_start = fields.Char( + # NOTE: a real Date field (date picker), but NOT a config_parameter field — + # res.config.settings Date fields don't round-trip via config_parameter in + # Odoo 19, so it is persisted manually in get_values/set_values as a + # 'YYYY-MM-DD' string under fusion_clock.pay_period_start (same pattern as + # fclk_report_recipient_user_ids). + fclk_pay_period_start = fields.Date( string='Pay Period Anchor Date', - config_parameter='fusion_clock.pay_period_start', - help="Start date for pay period calculations (YYYY-MM-DD format).", + help="The pay-period start date. Reports and the Bi-Weekly Period " + "filter/picker count forward from this anchor.", ) fclk_auto_generate_reports = fields.Boolean( string='Auto-Generate Reports', @@ -293,6 +298,11 @@ class ResConfigSettings(models.TransientModel): ','.join(str(uid) for uid in self.fclk_report_recipient_user_ids.ids)) else: ICP.set_param('fusion_clock.report_recipient_user_ids', '') + if self.fclk_pay_period_start: + ICP.set_param('fusion_clock.pay_period_start', + fields.Date.to_string(self.fclk_pay_period_start)) + else: + ICP.set_param('fusion_clock.pay_period_start', '') @api.model def get_values(self): @@ -308,4 +318,11 @@ class ResConfigSettings(models.TransientModel): res['fclk_report_recipient_user_ids'] = [(6, 0, user_ids)] except (ValueError, TypeError): pass + anchor_str = ICP.get_param('fusion_clock.pay_period_start', '') + if anchor_str: + try: + # Truncate to 'YYYY-MM-DD' to tolerate any legacy datetime-ish value. + res['fclk_pay_period_start'] = fields.Date.to_date(anchor_str[:10]) + except (ValueError, TypeError): + pass return res