yun_product/yuthon_notice/views/yuthon_notice_views.xml
李鹏宇 782bea26af 1
2026-06-26 09:40:27 +08:00

216 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_yuthon_notice_tree" model="ir.ui.view">
<field name="name">yuthon.notice.tree</field>
<field name="model">yuthon.notice</field>
<field name="arch" type="xml">
<list string="公告管理" decoration-success="notice_state == 'yes'"
decoration-info="notice_state == 'no'"
decoration-muted="notice_state == 'stop'">
<field name="name" required="1"/>
<field name="notice_type_id" string="类型" class="list_ids_width"/>
<field name="users_id" string="发布人" class="list_ids_width"/>
<field name="department_id" column_invisible="1"/>
<field name="users_ids" column_invisible="1"/>
<field name="create_date1"/>
<field name="end_date"/>
<field name="notice_state" class="list_ids_width"/>
<button name="on_sequence" string="置顶" invisible="sequence != 0" type="object" class="btn-primary"/>
<button name="no_sequence" string="取消置顶" invisible="sequence != 1" type="object" class="btn-primary"/>
<!-- <button name="look_up_notice_users" string="查阅情况" type="object" class="btn-primary"/>-->
<button name="stop_notice" string="终止" type="object" class="btn-primary"/>
<field name="sequence" column_invisible="1"/>
</list>
</field>
</record>
<record id="view_yuthon_notice_form" model="ir.ui.view">
<field name="name">yuthon.notice.form</field>
<field name="model">yuthon.notice</field>
<field name="arch" type="xml">
<form string="公告管理" create="0">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
invisible="urgency_level != 'emergency'"/>
<group col="4">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group>
<field name="is_this_company"/>
</group>
<group>
<field name="start_date"/>
</group>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group col="4">
<group>
<field name="notice_type_id"/>
</group>
<group>
<field name="users_id"/>
</group>
<group>
<field name="company_id" invisible="1"/>
<field name="work_end" invisible="1"/>
<field name="department_id" string="发布部门" invisible="1"/>
<field name="create_date1"/>
</group>
</group>
<group>
<field name="name" required="1"/>
<field name="notice_text" widget="tinymce"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
<group col="4" string="发布范围">
<group>
<field name="department_ids" widget="many2many_tags" context="{'tree_view_ref':'yuthon_notice.view_yuthon_cs_tree'}" domain = "[('company_id', '=', company_id)] if is_this_company else []" options="{'no_create': True}"/>
</group>
<group>
<field name="users_role_group_ids" widget="many2many_tags" options="{'no_create': True}"/>
</group>
<group>
<field name="users_role_ids" widget="many2many_tags" options="{'no_create': True}"/>
</group>
<group>
<field name="employee_ids" widget="many2many_tags" context="{'tree_view_ref':'yuthon_notice.view_yuthon_cs_tree'}" options="{'no_create': True}" domain = "[('company_id', '=', company_id), ('user_id.name', '!=', 'Administrator')] if is_this_company else []"/>
<field name="users_ids" invisible="1" widget="many2many_tags"/>
</group>
</group>
<group col="3">
<group>
<field name="is_sticky" string="置顶"/>
</group>
<group>
<field name="is_change_notice"/>
</group>
<group>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_yuthon_notice_tree2" model="ir.ui.view">
<field name="name">yuthon.notice.tree</field>
<field name="model">yuthon.notice</field>
<field name="arch" type="xml">
<list string="公告管理" edit="false" delete="false" create="false"
decoration-danger="is_notice_roger == 'no'"
decoration-success="is_notice_roger == 'yes'"
js_class="custom_notice_tree_button">
<field name="name"/>
<field name="notice_type_id" string="类型"/>
<field name="users_id" string="发布人" class="list_ids_width"/>
<field name="is_notice_roger"/>
<field name="department_id" column_invisible="1"/>
<field name="users_ids" column_invisible="1"/>
<field name="create_date1"/>
<field name="end_date" column_invisible="1"/>
</list>
</field>
</record>
<record id="view_yuthon_notice_form2" model="ir.ui.view">
<field name="name">yuthon.notice.form2</field>
<field name="model">yuthon.notice</field>
<field name="arch" type="xml">
<form create="false" edit="false" delete="false" string="公告管理">
<group col="5">
<group>
<field name="notice_type_id" string="发布类型"/>
</group>
<group>
<field name="users_id"/>
</group>
<group>
<field name="read_number"/>
</group>
<group>
<field name="create_date1"/>
</group>
<group>
<field name="start_date"/>
</group>
</group>
<div class="col-12 text-center">
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group>
<field name="notice_text" widget="tinymce" string=" "/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
</form>
</field>
</record>
<record id="view_yuthon_notice_filter" model="ir.ui.view">
<field name="name">yuthon.notice.search</field>
<field name="model">yuthon.notice</field>
<field name="arch" type="xml">
<search string="公告查询">
<field string="标题" name="name"/>
<field string="发布人" name="users_id"/>
<field string="正文" name="notice_text"/>
<field string="附件" name="documents_ids"/>
<field string="部门" name="department_id"/>
<filter string="未发布" name="no " domain="[('notice_state', '=', 'no')]"/>
<filter string="已发布" name="done " domain="[('notice_state', '=', 'done')]"/>
<group expand="0">
<filter name="group_statu" string="发布状态" context="{'group_by': 'notice_state'}"/>
<filter name="group_type" string="类型" context="{'group_by': 'notice_type_id'}"/>
<filter name="group_date" string="发布日期" context="{'group_by': 'create_date1'}"/>
</group>
</search>
</field>
</record>
<record id="approval_notice_action" model="ir.actions.act_window">
<field name="name">通知公告</field>
<field name="res_model">yuthon.notice</field>
<field name="view_mode">list,form</field>
<field name="domain">[('notice_state', '=', 'yes'),('users_ids', 'in', [uid])]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'list', 'view_id': ref('yuthon_notice.view_yuthon_notice_tree2')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_notice.view_yuthon_notice_form2')})]"/>
</record>
<record id="approval_notice_action2" model="ir.actions.act_window">
<field name="name">通知公告管理</field>
<field name="res_model">yuthon.notice</field>
<field name="view_mode">list,form</field>
</record>
<menuitem id="yuthon_notice_menu_config_root"
name="通知公告"
web_icon="yuthon_notice,static/description/icon.png"
sequence="1"/>
<!-- <menuitem id="yuthon_notice_menu1"-->
<!-- parent="yuthon_notice_menu_config_root"-->
<!-- name="通知公告"-->
<!-- action="approval_notice_action"-->
<!-- sequence="1"/>-->
<menuitem id="yuthon_notice_my_menu"
parent="yuthon_notice_menu_config_root"
name="通知公告管理"
action="approval_notice_action2"
sequence="2"/>
</odoo>