微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 Odoo 13

如何解决如何在 Odoo 13

Image Link

蓝色边框的框叫什么?以及如何修改红色边框中的字段?我想以编程方式修改这些值。

解决方法

在 Odoo 14 中,此弹出窗口在 odoo/addons/web/static/src/xml/web_calendar.xml

中定义
<t t-name="CalendarView.event.popover">
    <div class="o_cw_body">
        <ul class="list-group list-group-flush">
            <li t-if="!widget.hideDate and widget.eventDate.date" class="list-group-item">
                <i class="fa fa-fw fa-calendar-o"/>
                <b class="text-capitalize" t-esc="widget.eventDate.date"/> <small t-if="widget.eventDate.duration"><b t-esc="_.str.sprintf('(%s)',widget.eventDate.duration)"/></small>
            </li>
            <li t-if="!widget.hideTime and widget.eventTime.time" class="list-group-item">
                <i class="fa fa-fw fa-clock-o"/>
                <b t-esc="widget.eventTime.time"/> <small t-if="widget.eventTime.duration"><b t-esc="_.str.sprintf('(%s)',widget.eventTime.duration)"/></small>
            </li>
        </ul>
        <ul t-if="widget.isEventDetailsVisible()" class="list-group list-group-flush o_cw_popover_fields_secondary"/>
        <div class="card-footer border-top">
            <a t-if="widget.isEventEditable()" href="#" class="btn btn-primary o_cw_popover_edit">Edit</a>
            <a t-if="widget.isEventDeletable()" href="#" class="btn btn-secondary o_cw_popover_delete ml-2">Delete</a>
        </div>
    </div>
</t>

JavaScript 中的 Widget 就是这个 odoo/addons/web/static/src/js/views/calendar/calendar_popover.js

您可以对其进行扩展以修改其值或添加其他字段等:

var CalendarPopover = Widget.extend(WidgetAdapterMixin,StandaloneFieldManagerMixin,{
    template: 'CalendarView.event.popover',events: {
        'click .o_cw_popover_edit': '_onClickPopoverEdit','click .o_cw_popover_delete': '_onClickPopoverDelete',},/**
     * @constructor
     * @param {Widget} parent
     * @param {Object} eventInfo
     */
    init: function (parent,eventInfo) {
        this._super.apply(this,arguments);
        StandaloneFieldManagerMixin.init.call(this);
        this.hideDate = eventInfo.hideDate;
        this.hideTime = eventInfo.hideTime;
        this.eventTime = eventInfo.eventTime;
        this.eventDate = eventInfo.eventDate;
        this.displayFields = eventInfo.displayFields;
        this.fields = eventInfo.fields;
        this.event = eventInfo.event;
        this.modelName = eventInfo.modelName;
        this._canDelete = eventInfo.canDelete;
    },//... rest of the class

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。