354 lines
20 KiB
XML
354 lines
20 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<record id='view_yuthon_will_task_tree' model='ir.ui.view'>
|
|
<field name='name'>yuthon.will.task.tree</field>
|
|
<field name='model'>yuthon.will.task</field>
|
|
<field name='arch' type='xml'>
|
|
<tree string='日程'
|
|
decoration-muted="task_state == 'cancel'"
|
|
decoration-danger="priority == 'very_urgent'"
|
|
decoration-info="priority == 'urgent'"
|
|
decoration-success="priority == 'important'" limit="15" action="open_record" type="object"
|
|
>
|
|
<field name="task_type"/>
|
|
<field name='start_date' column_invisible="1"/>
|
|
<field name='task_time'/>
|
|
<field name='name' required="1"/>
|
|
<field name='employee_ids' widget="many2many_tags" required="1" options="{'no_create': True}"/>
|
|
<field name="address"/>
|
|
<field name='remarks'/>
|
|
<!-- <field name='document_ids' widget="many2many_tags"/>-->
|
|
<!-- <field name='employee_ids2' widget="many2many_tags" domain="[('user_role_ids.name', 'in', ['司机'])]" options="{'no_create': True}"/>-->
|
|
<!-- <field name='task_time_ids' widget="many2many_tags" required="1"/>-->
|
|
<field name='priority'/>
|
|
<field name='task_state' readonly="1"/>
|
|
<!-- <field name='users_ids' widget="many2many_tags" column_invisible="1"/>-->
|
|
<!-- <field name='user_role_ids' widget="many2many_tags" column_invisible="1"/>-->
|
|
<!-- <field name="employee_id" optional="hide"/>-->
|
|
<!-- <field name='creation_time' optional="hide"/>-->
|
|
<button name="button_add_comment" string="提醒" type="object" class="btn btn-blue"
|
|
invisible="task_state in ['done', 'cancel']"/>
|
|
<!-- <button name="back_wecom_msg" string="测试撤销" type="object" class="oe_highlight"/>-->
|
|
<button name="button_add_comment_cancel" string="取消" type="object" class="btn btn-blue"
|
|
invisible="task_state == 'cancel'"/>
|
|
<button name="schedule_reminders" string="提醒任务" type="object" class="btn btn-blue"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<record id='yuthon_will_task_search' model='ir.ui.view'>
|
|
<field name='name'>yuthon.will.task.search</field>
|
|
<field name='model'>yuthon.will.task</field>
|
|
<field name='arch' type='xml'>
|
|
<search string='日程'>
|
|
<field name="name"/>
|
|
<filter name="next_seven_days" string="周内事项" domain="[('start_date', '>=', context_today().strftime('%Y-%m-%d')),
|
|
('start_date', '<=', (context_today() + relativedelta(days=7)).strftime('%Y-%m-%d'))]"/>
|
|
<filter name="next_thirty_days" string="月内事项" domain="[('start_date', '>=', context_today().strftime('%Y-%m-%d')),
|
|
('start_date', '<=', (context_today() + relativedelta(days=30)).strftime('%Y-%m-%d'))]"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
<record id="view_yuthon_will_task_form" model="ir.ui.view">
|
|
<field name="name">yuthon.will.task.form</field>
|
|
<field name="model">yuthon.will.task</field>
|
|
<field name="arch" type="xml">
|
|
<form string="日程">
|
|
<sheet>
|
|
<widget name="web_ribbon" title="重要不紧急" bg_color="text-bg-success"
|
|
invisible="priority != 'important'"/>
|
|
<widget name="web_ribbon" title="紧急不重要" bg_color="text-bg-warning"
|
|
invisible="priority != 'urgent'"/>
|
|
<widget name="web_ribbon" title="重要且紧急" bg_color="text-bg-danger"
|
|
invisible="priority != 'very_urgent'"/>
|
|
<group col="3">
|
|
<group>
|
|
<field name="code" readonly="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="is_this_company" string="本公司"/>
|
|
</group>
|
|
<group>
|
|
<field name="priority"/>
|
|
</group>
|
|
</group>
|
|
<div class="oe_title">
|
|
<label for="name"/>
|
|
<h1>
|
|
<field name="name" required="1"/>
|
|
</h1>
|
|
</div>
|
|
<group col="2">
|
|
<group>
|
|
<label for="start_date" string="开始日期"/>
|
|
<div class="d-inline-flex w-100">
|
|
<field name="start_date" string="开始日期" class="me-2"
|
|
style="max-width: 6rem !important;"/>
|
|
<field name="task_week" string="" class="me-2" style="max-width: 4rem !important;"/>
|
|
<field name="request_hour_from" string=" " class="ms-2"
|
|
style="max-width: 5rem !important;"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<group col="2">
|
|
<group>
|
|
<label for="request_hour_to" string="结束日期"/>
|
|
<div class="d-inline-flex w-100">
|
|
<field name="start_date" string="结束日期" class="me-2"
|
|
style="max-width: 6rem !important;"/>
|
|
<field name="task_week" string="" class="me-2" style="max-width: 4rem !important;"/>
|
|
<field name="request_hour_to" string=" " class="ms-2"
|
|
style="max-width: 5rem !important;"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="task_time_ids" widget="many2many_tags" required="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="employee_id"/>
|
|
<field name="task_state" invisible="1"/>
|
|
<field name="company_id" invisible="1"/>
|
|
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}"
|
|
domain="[('company_id', '=', company_id)] if is_this_company else []"/>
|
|
<field name="user_role_ids" widget="many2many_tags" invisible="1"/>
|
|
</group>
|
|
<group col="2">
|
|
<group>
|
|
<field name="address"/>
|
|
</group>
|
|
<group>
|
|
<field name="employee_ids2" widget="many2many_tags"
|
|
domain="[('company_id', '=', company_id), ('user_role_ids.name', 'in', ['司机'])] if is_this_company else [('user_role_ids.name', 'in', ['司机'])]"
|
|
options="{'no_create': True}"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="remarks"/>
|
|
<field name="document_ids" widget="preview_many2many"/>
|
|
<field name="creation_time" invisible="1"/>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record id='view_yuthon_will_task_tree2' model='ir.ui.view'>
|
|
<field name='name'>yuthon.will.task.tree2</field>
|
|
<field name='model'>yuthon.will.task</field>
|
|
<field name='arch' type='xml'>
|
|
<tree string='日程'
|
|
decoration-muted="task_state == 'cancel'"
|
|
decoration-danger="priority == 'very_urgent'"
|
|
decoration-info="priority == 'urgent'"
|
|
decoration-success="priority == 'important'" create="false" edit="false"
|
|
js_class="custom_task_tree_button" limit="15">
|
|
<field name='start_date' column_invisible="1"/>
|
|
<field name='task_time'/>
|
|
<field name='name' required="1"/>
|
|
<field name='employee_ids' widget="many2many_tags" required="1" options="{'no_create': True}"/>
|
|
<field name="address"/>
|
|
<field name='remarks'/>
|
|
<!-- <field name='document_ids' widget="many2many_tags"/>-->
|
|
<!-- <field name='employee_ids2' widget="many2many_tags" domain="[('user_role_ids.name', 'in', ['司机'])]" options="{'no_create': True}"/>-->
|
|
<!-- <field name='task_time_ids' widget="many2many_tags" required="1"/>-->
|
|
<field name='priority'/>
|
|
<field name='task_state' readonly="1"/>
|
|
<!-- <field name='users_ids' widget="many2many_tags" column_invisible="1"/>-->
|
|
<!-- <field name='user_role_ids' widget="many2many_tags" column_invisible="1"/>-->
|
|
<!-- <field name="employee_id" optional="hide"/>-->
|
|
<!-- <field name='creation_time' optional="hide"/>-->
|
|
<button name="button_add_comment" string="提醒" type="object" class="btn btn-blue"
|
|
invisible="task_state in ['done', 'cancel']"/>
|
|
<button name="button_add_comment_cancel" string="取消" type="object" class="btn btn-blue"
|
|
invisible="task_state == 'cancel'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<record id="view_yuthon_will_task_form2" model="ir.ui.view">
|
|
<field name="name">yuthon.will.task.message.form</field>
|
|
<field name="model">yuthon.will.task</field>
|
|
<field name="arch" type="xml">
|
|
<form string="日程" create="false">
|
|
<sheet>
|
|
<widget name="web_ribbon" title="重要不紧急" bg_color="text-bg-success"
|
|
invisible="priority != 'important'"/>
|
|
<widget name="web_ribbon" title="紧急不重要" bg_color="text-bg-warning"
|
|
invisible="priority != 'urgent'"/>
|
|
<widget name="web_ribbon" title="重要且紧急" bg_color="text-bg-danger"
|
|
invisible="priority != 'very_urgent'"/>
|
|
<group col="3">
|
|
<group>
|
|
<field name="code" readonly="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="is_this_company" string="本公司"/>
|
|
</group>
|
|
<group>
|
|
<field name="priority"/>
|
|
</group>
|
|
</group>
|
|
<div class="oe_title">
|
|
<label for="name"/>
|
|
<h1>
|
|
<field name="name" required="1"/>
|
|
</h1>
|
|
</div>
|
|
<group col="2">
|
|
<group>
|
|
<label for="start_date" string="开始日期"/>
|
|
<div class="d-inline-flex w-100">
|
|
<field name="start_date" string="开始日期" class="me-2"
|
|
style="max-width: 6rem !important;"/>
|
|
<field name="task_week" string="" class="me-2" style="max-width: 4rem !important;"/>
|
|
<field name="request_hour_from" string=" " class="ms-2"
|
|
style="max-width: 5rem !important;"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<group col="2">
|
|
<group>
|
|
<label for="request_hour_to" string="结束日期"/>
|
|
<div class="d-inline-flex w-100">
|
|
<field name="start_date" string="结束日期" class="me-2" readonly="1"
|
|
style="max-width: 6rem !important;"/>
|
|
<field name="task_week" string="" class="me-2" readonly="1" style="max-width: 4rem !important;"/>
|
|
<field name="request_hour_to" string=" " class="ms-2"
|
|
style="max-width: 5rem !important;"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="employee_id" domain="[('company_id', '=', company_id)]"/>
|
|
<field name="company_id" invisible="1"/>
|
|
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
|
<field name='users_ids' widget="many2many_tags" invisible="1"/>
|
|
<field name="user_role_ids" widget="many2many_tags" invisible="1"/>
|
|
</group>
|
|
<group col="2">
|
|
<group>
|
|
<field name="address"/>
|
|
</group>
|
|
<group>
|
|
<field name='employee_ids2' widget="many2many_tags"
|
|
domain="[('user_role_ids.name', 'in', ['司机'])]" options="{'no_create': True}"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="remarks"/>
|
|
<field name="document_ids" widget="preview_many2many"/>
|
|
<field name="creation_time" invisible="1"/>
|
|
</group>
|
|
</sheet>
|
|
<!-- <div class="oe_chatter">-->
|
|
<!-- <field name="message_follower_ids" groups="base.group_user"/>-->
|
|
<!-- <field name="activity_ids"/>-->
|
|
<!-- <field name="message_ids"/>-->
|
|
<!-- </div>-->
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record id="view_yuthon_will_task_kanban" model="ir.ui.view">
|
|
<field name="name">yuthon.will.task.kanban</field>
|
|
<field name="model">yuthon.will.task</field>
|
|
<field name="arch" type="xml">
|
|
<kanban>
|
|
<field name="name"/>
|
|
<field name="task_state"/>
|
|
<field name="task_time"/>
|
|
<field name="employee_id"/>
|
|
<field name="employee_ids"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_global_click" style="border-radius: 8px; padding: 12px; margin-bottom: 8px;">
|
|
<!-- 标题行:任务名称 + 状态标签 -->
|
|
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px;">
|
|
<div style="font-weight: bold; font-size: 14px; line-height: 1.5; flex: 1; margin-right: 8px;">
|
|
<field name="name"/>
|
|
</div>
|
|
<div>
|
|
<field name="task_state" widget="badge"
|
|
decoration-success="task_state == 'done'"
|
|
decoration-info="task_state == 'will'"
|
|
decoration-muted="task_state == 'cancel'"/>
|
|
</div>
|
|
</div>
|
|
<!-- 时间行 -->
|
|
<div style="color: #555; font-size: 13px; margin-bottom: 4px;">
|
|
<field name="task_time"/>
|
|
</div>
|
|
<!-- 经办人 + 共N人 -->
|
|
<div style="color: #555; font-size: 13px;">
|
|
经办人:<field name="employee_id"/>
|
|
<t t-if="record.employee_ids.raw_value">
|
|
| 共<t t-esc="record.employee_ids.raw_value.length"/>人
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_calendar_event_calendar" model="ir.ui.view">
|
|
<field name="name">yuthon.will.task.calendar</field>
|
|
<field name="model">yuthon.will.task</field>
|
|
<field name="priority" eval="2"/>
|
|
<field name="arch" type="xml">
|
|
<calendar string="日程"
|
|
date_start="start_date"
|
|
event_open_popup="true"
|
|
event_limit="5"
|
|
quick_create="false"
|
|
quick_create_view_id="%(yuthon_will_task.view_yuthon_will_task_form)d"
|
|
color="employee_ids">
|
|
<field name="priority"/>
|
|
</calendar>
|
|
</field>
|
|
</record>
|
|
<record id='view_yuthon_will_task_action' model='ir.actions.act_window'>
|
|
<field name='name'>我的日程</field>
|
|
<field name='res_model'>yuthon.will.task</field>
|
|
<field name='view_mode'>tree,kanban,calendar,form</field>
|
|
<field name='domain'>[('users_ids', 'in', [uid]), ('task_state', '!=', 'cancel')]</field>
|
|
<field name="context">{'search_default_next_seven_days': 1}</field>
|
|
<field name="view_ids" eval="[(5, 0, 0),
|
|
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_will_task.view_yuthon_will_task_tree2')}),
|
|
(0, 0, {'view_mode': 'kanban', 'view_id': ref('yuthon_will_task.view_yuthon_will_task_kanban')}),
|
|
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_will_task.view_yuthon_will_task_form2')})]" />
|
|
</record>
|
|
<record id='view_yuthon_will_task_action2' model='ir.actions.act_window'>
|
|
<field name='name'>日程管理</field>
|
|
<field name='res_model'>yuthon.will.task</field>
|
|
<field name='view_mode'>tree,kanban,calendar,form</field>
|
|
<field name='domain'>[('task_state', '!=', 'cancel')]</field>
|
|
<field name="context">{'search_default_next_seven_days': 1}</field>
|
|
<field name="view_ids" eval="[(5, 0, 0),
|
|
(0, 0, {'view_mode': 'kanban', 'view_id': ref('yuthon_will_task.view_yuthon_will_task_kanban')})]" />
|
|
</record>
|
|
<record id='view_yuthon_will_task_action21' model='ir.actions.act_window'>
|
|
<field name='name'>领导日程</field>
|
|
<field name='res_model'>yuthon.will.task</field>
|
|
<field name='view_mode'>tree,calendar,form</field>
|
|
<field name='domain'>[('task_state', '!=', 'cancel')]</field>
|
|
<field name="context">{'search_default_next_seven_days': 1}</field>
|
|
</record>
|
|
<record id='view_yuthon_will_task_action4' model='ir.actions.act_window'>
|
|
<field name='name'>领导日程</field>
|
|
<field name='res_model'>yuthon.will.task</field>
|
|
<field name='view_mode'>tree,kanban,calendar,form</field>
|
|
<field name='domain'>[('user_role_ids.name', 'in', ['董事长', '分管领导', '总经理', '部门副经理', '副总经理',
|
|
'司机']), ('task_state', '!=', 'cancel')]
|
|
</field>
|
|
<field name="context">{'search_default_next_seven_days': 1}</field>
|
|
<field name="view_ids" eval="[(5, 0, 0),
|
|
(0, 0, {'view_mode': 'kanban', 'view_id': ref('yuthon_will_task.view_yuthon_will_task_kanban')})]" />
|
|
</record>
|
|
<record id="all_yuthon_will_task" model="ir.actions.server">
|
|
<field name="name">更新</field>
|
|
<field name="model_id" ref="yuthon_will_task.model_yuthon_will_task"/>
|
|
<field name="binding_model_id" ref="yuthon_will_task.model_yuthon_will_task"/>
|
|
<field name="state">code</field>
|
|
<field name="code">action = model.one_time()</field>
|
|
</record>
|
|
</odoo>
|