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 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Fusion Clock',
|
'name': 'Fusion Clock',
|
||||||
'version': '19.0.3.15.1',
|
'version': '19.0.3.15.2',
|
||||||
'category': 'Human Resources/Attendances',
|
'category': 'Human Resources/Attendances',
|
||||||
'summary': 'Complete Employee T&A with Geofencing, Shifts, Penalties, Overtime, Kiosk, Dashboard & Payroll Export',
|
'summary': 'Complete Employee T&A with Geofencing, Shifts, Penalties, Overtime, Kiosk, Dashboard & Payroll Export',
|
||||||
'description': """
|
'description': """
|
||||||
|
|||||||
@@ -199,10 +199,15 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
default='biweekly',
|
default='biweekly',
|
||||||
help="How often attendance reports are generated.",
|
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',
|
string='Pay Period Anchor Date',
|
||||||
config_parameter='fusion_clock.pay_period_start',
|
help="The pay-period start date. Reports and the Bi-Weekly Period "
|
||||||
help="Start date for pay period calculations (YYYY-MM-DD format).",
|
"filter/picker count forward from this anchor.",
|
||||||
)
|
)
|
||||||
fclk_auto_generate_reports = fields.Boolean(
|
fclk_auto_generate_reports = fields.Boolean(
|
||||||
string='Auto-Generate Reports',
|
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))
|
','.join(str(uid) for uid in self.fclk_report_recipient_user_ids.ids))
|
||||||
else:
|
else:
|
||||||
ICP.set_param('fusion_clock.report_recipient_user_ids', '')
|
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
|
@api.model
|
||||||
def get_values(self):
|
def get_values(self):
|
||||||
@@ -308,4 +318,11 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
res['fclk_report_recipient_user_ids'] = [(6, 0, user_ids)]
|
res['fclk_report_recipient_user_ids'] = [(6, 0, user_ids)]
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
pass
|
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
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user