bemade_sports_clinic:
- Add 'account' to depends to ensure invoice portal templates are present - Hide invoice cards for coaches/therapists via override of account.portal_my_home_invoice - Events portal: create/edit templates and controller adjustments for therapist workflow - Minor portal home styling and visibility tweaks for clinic roles
This commit is contained in:
parent
8ca4ef5af3
commit
f5e1751da7
5 changed files with 12 additions and 5 deletions
|
|
@ -49,6 +49,7 @@ This module provides a complete sports medicine clinic management solution with
|
||||||
"contacts",
|
"contacts",
|
||||||
"phone_validation", # For phone number formatting in patient contacts
|
"phone_validation", # For phone number formatting in patient contacts
|
||||||
"project", # Required for project.task (Events) functionality
|
"project", # Required for project.task (Events) functionality
|
||||||
|
"account", # Ensure account portal templates (e.g., portal_my_home_invoice) are available
|
||||||
],
|
],
|
||||||
"external_dependencies": {
|
"external_dependencies": {
|
||||||
"python": [
|
"python": [
|
||||||
|
|
|
||||||
|
|
@ -526,10 +526,16 @@ class EventsPortal(CustomerPortal, AccessControlMixin):
|
||||||
else:
|
else:
|
||||||
raise UserError(_('Event end time is required.'))
|
raise UserError(_('Event end time is required.'))
|
||||||
|
|
||||||
if 'therapist_start' in post and post['therapist_start']:
|
# Default therapist times to event times if not provided
|
||||||
|
if post.get('therapist_start'):
|
||||||
create_vals['therapist_start'] = _parse_dt(post['therapist_start'])
|
create_vals['therapist_start'] = _parse_dt(post['therapist_start'])
|
||||||
if 'therapist_end' in post and post['therapist_end']:
|
else:
|
||||||
|
create_vals['therapist_start'] = create_vals['date_start']
|
||||||
|
|
||||||
|
if post.get('therapist_end'):
|
||||||
create_vals['therapist_end'] = _parse_dt(post['therapist_end'])
|
create_vals['therapist_end'] = _parse_dt(post['therapist_end'])
|
||||||
|
else:
|
||||||
|
create_vals['therapist_end'] = create_vals['date_end']
|
||||||
|
|
||||||
# Assigned staff (same handling as save_event)
|
# Assigned staff (same handling as save_event)
|
||||||
staff_param = None
|
staff_param = None
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,7 @@
|
||||||
var startDt = parseLocal(dateStart.value);
|
var startDt = parseLocal(dateStart.value);
|
||||||
if (!startDt) return;
|
if (!startDt) return;
|
||||||
if (therapistStart) {
|
if (therapistStart) {
|
||||||
therapistStart.value = formatLocal(addMinutes(startDt, -120));
|
therapistStart.value = formatLocal(startDt);
|
||||||
}
|
}
|
||||||
if (dateEnd) {
|
if (dateEnd) {
|
||||||
var endDt = addMinutes(startDt, 120);
|
var endDt = addMinutes(startDt, 120);
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,7 @@
|
||||||
var startDt = parseLocal(dateStart.value);
|
var startDt = parseLocal(dateStart.value);
|
||||||
if (!startDt) return;
|
if (!startDt) return;
|
||||||
if (therapistStart) {
|
if (therapistStart) {
|
||||||
therapistStart.value = formatLocal(addMinutes(startDt, -120));
|
therapistStart.value = formatLocal(startDt);
|
||||||
}
|
}
|
||||||
if (dateEnd) {
|
if (dateEnd) {
|
||||||
var endDt = addMinutes(startDt, 120);
|
var endDt = addMinutes(startDt, 120);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Hide Invoice cards for coaches and treatment professionals -->
|
<!-- Hide Invoice cards for coaches and treatment professionals (requires 'account') -->
|
||||||
<template id="portal_my_home_invoice_coach_override" inherit_id="account.portal_my_home_invoice" priority="50">
|
<template id="portal_my_home_invoice_coach_override" inherit_id="account.portal_my_home_invoice" priority="50">
|
||||||
<xpath expr="//div[@id='portal_client_category']" position="attributes">
|
<xpath expr="//div[@id='portal_client_category']" position="attributes">
|
||||||
<attribute name="t-if">not request.env.user.has_group('bemade_sports_clinic.group_portal_team_coach') and not request.env.user.has_group('bemade_sports_clinic.group_portal_treatment_professional')</attribute>
|
<attribute name="t-if">not request.env.user.has_group('bemade_sports_clinic.group_portal_team_coach') and not request.env.user.has_group('bemade_sports_clinic.group_portal_treatment_professional')</attribute>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue