176 lines
9.2 KiB
XML
176 lines
9.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="room_room_view_search" model="ir.ui.view">
|
|
<field name="name">Room search view</field>
|
|
<field name="model">room.room</field>
|
|
<field name="arch" type="xml">
|
|
<search string="会议室">
|
|
<filter name="name" string="名称"/>
|
|
<filter name="is_meet_tv" string="电视" domain="[('is_meet_tv', '=', True)]"/>
|
|
<filter name="is_meet_phone" string="电话" domain="[('is_meet_phone', '=', True)]"/>
|
|
<filter name="is_meet_projector" string="投影仪" domain="[('is_meet_projector', '=', True)]"/>
|
|
<filter name="is_meet_whiteboard" string="白板" domain="[('is_meet_whiteboard', '=', True)]"/>
|
|
<filter name="is_meet_video" string="视频" domain="[('is_meet_video', '=', True)]"/>
|
|
<filter name="meet_capacity" string="二十人以上" domain="[('meet_capacity', '>', 20)]"/>
|
|
<filter name="meet_capacity" string="二十人以下" domain="[('meet_capacity', '<', 20)]"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="room_room_view_kanban" model="ir.ui.view">
|
|
<field name="name">room.room.view.kanban</field>
|
|
<field name="model">room.room</field>
|
|
<field name="arch" type="xml">
|
|
<kanban>
|
|
<field name="is_available"/>
|
|
<field name="next_booking_start"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_global_click o_kanban_record_has_image_fill">
|
|
<field invisible="not room_background_image" name="room_background_image"
|
|
class="o_kanban_image_fill_left" options="{'size': [150,100]}" widget="image"/>
|
|
<div class="oe_kanban_details ml8">
|
|
<div class="o_kanban_record_top">
|
|
<strong class="o_kanban_record_title">
|
|
<field name="name"/>
|
|
</strong>
|
|
</div>
|
|
<div class="o_kanban_record_bottom">
|
|
<div t-attf-class="py-1 px-2 text-bg-#{record.is_available.raw_value ? 'success' : 'danger'}">
|
|
<t t-if="record.is_available.raw_value">Available</t>
|
|
<t t-else="">Busy</t>
|
|
<!-- Show time if next booking is today, otherwise show date -->
|
|
<t t-if="record.next_booking_start.value">
|
|
<t t-set="start_datetime"
|
|
t-value="luxon.DateTime.fromISO(record.next_booking_start.raw_value)"/>
|
|
Until
|
|
<t t-if="start_datetime.hasSame(luxon.DateTime.now(), 'day')"
|
|
t-out="start_datetime.toLocaleString(luxon.DateTime.TIME_SIMPLE)"/>
|
|
<t t-else=""
|
|
t-out="start_datetime.toLocaleString(luxon.DateTime.DATE_SHORT)"/>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="room_room_view_list" model="ir.ui.view">
|
|
<field name="name">room.room.view.list</field>
|
|
<field name="model">room.room</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="name"/>
|
|
<field name="office_address"/>
|
|
<field name="department_id"/>
|
|
<field name="is_available" string="Is Currently Available"/>
|
|
<field name="next_booking_start"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="room_room_view_form" model="ir.ui.view">
|
|
<field name="name">room.room.view.form</field>
|
|
<field name="model">room.room</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<field name="is_available" invisible="1"/>
|
|
<!-- <header>-->
|
|
<!-- <button string="Open" type="object" name="action_open_booking_view"/>-->
|
|
<!-- </header>-->
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_view_bookings" type="object"
|
|
class="oe_stat_button" icon="fa-calendar">
|
|
<div class="o_form_field o_stat_info">
|
|
<span class="o_stat_text">
|
|
<field class="o_stat_value me-1" name="bookings_count"/>
|
|
<span invisible="bookings_count == 1">Bookings</span>
|
|
<span invisible="bookings_count != 1">Booking</span>
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
<div class="badge rounded-pill text-bg-success float-end fs-6 border-0"
|
|
invisible="not is_available">
|
|
Available
|
|
</div>
|
|
<div class="badge rounded-pill text-bg-danger float-end fs-6 border-0" invisible="is_available">
|
|
Busy
|
|
</div>
|
|
<div class="oe_title mb24">
|
|
<label for="name"/>
|
|
<h1>
|
|
<field name="name" placeholder="Room Name"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="office_address"/>
|
|
<field name="department_id"/>
|
|
<field name="meeting_type_template"/>
|
|
<field name="meet_document_id"/>
|
|
<field name="short_code" invisible="1"/>
|
|
</group>
|
|
<!-- <group>-->
|
|
<!-- <field name="room_booking_url" widget="CopyClipboardChar"/>-->
|
|
<!-- </group>-->
|
|
</group>
|
|
<notebook>
|
|
<page name="会议室信息">
|
|
<group>
|
|
<group>
|
|
<field name="bookable_background_color" widget="color"/>
|
|
<field name="booked_background_color" widget="color"/>
|
|
<label for="meet_m2"/>
|
|
<div class="o_row" name="volume">
|
|
<span>
|
|
<field name="meet_m2" string="会议室面积" class="oe_inline"/>m²
|
|
</span>
|
|
</div>
|
|
<field name="meet_capacity" string="容纳人数" class="oe_inline"/>
|
|
</group>
|
|
<group>
|
|
<field name="room_background_image" widget="image"/>
|
|
</group>
|
|
</group>
|
|
<group string="会议设备" class="col-5">
|
|
<group class="col">
|
|
<field name="is_meet_tv" string="电视" />
|
|
<field name="is_meet_phone" string="电话"/>
|
|
<field name="is_meet_projector" string="投影仪"/>
|
|
</group>
|
|
<group class="col">
|
|
<field name="is_meet_whiteboard" string="白板" />
|
|
<field name="is_meet_video" string="视频" />
|
|
</group>
|
|
</group>
|
|
</page>
|
|
<page name="描述">
|
|
<field name="description" placeholder="E.g. projector, capacity 6 people" widget="tinymce"/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="room_room_action" model="ir.actions.act_window">
|
|
<field name="name">会议室</field>
|
|
<field name="res_model">room.room</field>
|
|
<field name="view_mode">kanban,list,form</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create Rooms
|
|
</p>
|
|
<p>
|
|
They can then be booked for meetings from a Tablet or the back-end.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
</odoo>
|