我刚刚问过:How to display your own kanban card in calendar view in Odoo 11?
我以为我使用的是11版,但当时是10版,这就是templates
标签不起作用的原因。当然,我必须在版本10中使用它。问题是,这两个版本目前都完全不同,并且templates
标签不存在。
我的目的
我想在日历视图(view_calendar_event_calendar
模式的calendar.event
中显示自定义卡片)。 templates
标签的作用是完美的,但是看来我不能在版本10中使用它。
某些信息
我一直在寻找 base / rng / view.rng 中的calendar
标签的可能性:
<rng:define name="calendar">
<rng:element name="calendar">
<rng:optional><rng:attribute name="string" /></rng:optional>
<rng:optional><rng:attribute name="color" /></rng:optional>
<rng:optional><rng:attribute name="date_start" /></rng:optional>
<rng:optional><rng:attribute name="date_stop" /></rng:optional>
<rng:optional><rng:attribute name="day_length" /></rng:optional>
<rng:optional><rng:attribute name="date_delay" /></rng:optional>
<rng:optional><rng:attribute name="all_day" /></rng:optional>
<rng:optional><rng:attribute name="event_open_popup" /></rng:optional>
<rng:optional><rng:attribute name="attendee" /></rng:optional>
<rng:optional><rng:attribute name="color_is_attendee" /></rng:optional>
<rng:optional><rng:attribute name="avatar_filter" /></rng:optional>
<rng:optional><rng:attribute name="avatar_model" /></rng:optional>
<rng:optional><rng:attribute name="avatar_title" /></rng:optional>
<rng:optional><rng:attribute name="use_contacts" /></rng:optional>
<rng:optional><rng:attribute name="quick_add" /></rng:optional>
<rng:optional><rng:attribute name="display" /></rng:optional>
<rng:optional><rng:attribute name="type" /></rng:optional>
<rng:optional>
<rng:attribute name="mode">
<rng:choice>
<rng:value>month</rng:value>
<rng:value>week</rng:value>
<rng:value>day</rng:value>
</rng:choice>
</rng:attribute>
</rng:optional>
<rng:oneOrMore>
<rng:ref name="field"/>
</rng:oneOrMore>
<rng:zeroOrMore>
<rng:ref name="html"/>
</rng:zeroOrMore>
</rng:element>
</rng:define>
似乎我可以在html
标签内声明一个calendar
元素。
我的尝试
但是我做不到,我收到了JS错误未捕获的TypeError:无法读取未定义的属性'type'。这是我到目前为止(在很多事情中)尝试过的:
<record id="view_calendar_event_calendar" model="ir.ui.view">
<field name="name">calendar.event.calendar</field>
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_calendar"/>
<field name="arch" type="xml">
<xpath expr="//calendar[1]" position="replace">
<calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration"
all_day="allday" display="[color_confirmed]" color="color_confirmed"
event_open_popup="%(calendar.view_calendar_event_form_popup)s" mode="month">
<field name="name"/>
<html>
<div>HELLO</div>
</html>
</calendar>
</xpath>
</field>
</record>
有人知道如何实现我的目标吗?