Is it 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"/>
<template>
<t t-name="something"></t>
</template>
</calendar>
</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 else 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?
You can Define in Calendar Controller Following Attributes. This is the Rules are Define in odoo Framework this all are Attribute is use in calendar tag. so you can not use template tag in calendar.
Example :
<field name="arch" type="xml">
<calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday"
display="[name]" color="color_partner_id" attendee="partner_ids" avatar_model="res.partner"
use_contacts="True" event_open_popup="%(calendar.view_calendar_event_form_popup)s">
<field name="name"/>
<field name="user_id"/>
<field name="color_partner_id"/>
<field name="partner_ids"/>
</calendar>
</field>
If you change the view of the calendar then you can modified in web_calendar module.
i hope you understand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With