[Python] How to display the "New" button in calendar view like in tree or kanban views?

Discussão em 'Python' iniciado por Stack, Abril 22, 2025.

  1. Stack

    Stack Membro Participativo

    I’m working with Odoo 17 and I’ve created a calendar view for a custom model. In tree and kanban views, the standard "New" button appears at the top left, allowing users to create a new record.

    However, in the calendar view, this "New" button does not appear. I have already set create="true" in my calendar view definition, and quick creation is working when clicking on the calendar itself.

    But I would like to also have the standard "New" button (like in other views) visible in the calendar view’s header. Is there a way to enable or force this button to appear in the calendar view?

    Here is a snippet from my view:

    <calendar string="Appointments"
    date_start="date"
    date_stop="date_to"
    mode="week"
    color="state"
    create="true"
    event_open_popup="true"
    quick_create="true"
    quick_create_view_id="%(view_dental_appointment_quick_create)d">
    <field name="name"/>
    <field name="patient_id"/>
    <field name="physician_id"/>
    <field name="department_id"/>
    <field name="duration_id"/>
    <field name="phone"/>
    <field name="cabin_id"/>
    <field name="state"/>
    </calendar>

    Continue reading...

Compartilhe esta Página