Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
9576 Vizualizări

I is possible to use Qweb template in calendar view? I want to modify it a bit, but all I can do is just add new fields to be showed in calendar item, like this - ```field1, field2, field3...```

Is there any better way to customize calendar view, like you can with kanban view by using Qweb templating engine?

For example if I use like this:

        <record model="ir.ui.view" id="view_calendar_service_work_calendar">
            <field name="name">Service Works Calendar</field>
            <field name="model">calendar.service.work</field>
            <field name="priority" eval="1"/>
            <field name="arch" type="xml">
                <calendar string="Service Works" date_start="start_time" color="employee_id" date_stop="end_time" mode="week">
                    <field name="name"/>
                    <field name="employee_id"/>                                     
                </calendar>

               <template>

                   <t t-name="something"></t>

              </template>
            </field>
        </record>  

This will throw error:

 Uncaught TypeError: Cannot read property 'type' of undefined 

http://localhost:8090/web_calendar/static/src/js/web_calendar.js:414

As a matter of fact, if I use anything other than field tag, it will throw that error. I can't even use div tag. So it seems you can't style calendar at all?

Imagine profil
Abandonează
Cel mai bun răspuns

You cannot have that kind of customization when it comes to the calendar view.

The calendar view is based on this library: http://dhtmlx.com/docs/products/dhtmlxScheduler/

So if you want to modify how it looks, you will have to modify the way Odoo interacts with that library and the way it renders events. You can find it in web_calendar

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
sept. 15
4326
2
sept. 23
15006
1
ian. 19
8693
1
apr. 15
7094
5
mar. 15
14464