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

I have an entity "appointment" with a date_appointment attribute. I have also created a Calendar view for that appointment. An appointment should never be scheduled on weekends, so I have disable those days in odoo datepicker (in the doem view). But when I clic on any Satursday or sunday in the Calendar view it shows the form view where I can create an appointment for that day. Is there any way I can disable those days in Odoo Calendar, so the user cannot clic on any weekend an create appointments. I have already disable the quick_add option

<record id="appointment_view_calendar" model="ir.ui.view">
    <field name="name">appointment.view.calendar</field>
    <field name="model">tico_hospital.appointment</field>
    <field name="arch" type="xml">
        <calendar string="Consultas programadas" mode="week" date_start="date_appointment" quick_add="False" color="patient_id">
            <field name="patient_id"/>
            <field name="reason"/>         
        </calendar>
    </field>
</record>  
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

For disabling particular days from the odoo date-picker, you can achieve it like this,

<field name="appointment_date" options='{"datepicker": {"daysOfWeekDisabled": [5, 6]}}'/>


See more at: Disable Selection Of Particular Days From Odoo DatePicker - Date Field

Thanks

อวตาร
ละทิ้ง

Hi, how about disabling a specific time of a date? I don't need to disable a full date. Any ideas ?

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 20
3838
1
ส.ค. 15
8781
1
ก.ค. 25
455
Internal Team Grouping for Calendar แก้ไขแล้ว
2
มิ.ย. 25
828
1
พ.ค. 25
2412