Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
649 มุมมอง

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

 

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 25
1536
Select multiple elements with XPath แก้ไขแล้ว
5
ส.ค. 24
47070
0
พ.ค. 24
1684
2
เม.ย. 24
2778
3
มิ.ย. 23
6216