Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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 


Ảnh đại diện
Huỷ bỏ



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

 

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 25
1504
5
thg 8 24
47038
0
thg 5 24
1671
2
thg 4 24
2771
3
thg 6 23
6188