i have alterate de appointment.type and calendar.event pyhton code to have for every slot_ids in appointment.type an affected resource
import logging
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__)
class AppointmentSlot(models.Model):
_inherit = "appointment.slot"
resource_id = fields.Many2one(
"resource.resource",
string="Ressource assignée",
domain="[('id', 'in', resource_ids.ids)]",
help="Sélectionnez la ressource spécifique pour ce créneau."
)
class CalendarEvent(models.Model):
_inherit = "calendar.event"
resource_id = fields.Many2one("resource.resource", string="Ressource assignée")
@api.onchange('start')
def _onchange_start(self):
"""Met à jour la ressource en fonction du créneau sélectionné"""
if self.start:
slot = self.env['appointment.slot'].search([
('start_datetime', '<=', self.start),
('end_datetime', '>=', self.start)
], limit=1)
self.resource_id = slot.resource_id if slot else False
Now i want to alterate the website view how should i proceed
Thanks you
Thank you for your mail.
I am out of the office and back on 04.03.2025
Mails will be read and answered with delay.
Best Regards ... Thomas Klein