<?xml version="1.0" encoding="utf-8"?>
<!--
	Copyright (C) 2019 SuXueFeng GNU
-->
<odoo>

    <record id="we_approval_template_tree_view" model="ir.ui.view">
        <field name="name">审批模板</field>
        <field name="model">wxwork.approval.template</field>
        <field name="arch" type="xml">
<!--             <tree default_order="id desc" js_class="we_approval_tem_tree_class"> -->
            <tree js_class="we_approval_tem_tree_class">
                <field name="name"/>
                <field name="process_code"/>
                <field name="company_id"/>
            </tree>
        </field>
    </record>

    <record id="wxwork_approval_template_form" model="ir.ui.view">
		<field name="name">审批模板</field>
		<field name="model">wxwork.approval.template</field>
		<field name="arch" type="xml">
            <form>
            <group>
                <field name="name"/>
                <field name="process_code"/>
                <field name="content_ids"/>
                <field name="vacation_config_id" attrs="{'invisible': [('name', '!=', '请假')]}"/>
<!--                 <field name="vacation_config_id"/> -->
<!--                 <field name="company_id"/> -->
<!--                 <field name="choose_department"/> -->
                <field name="use_template_approver"/>
                <field name="approver" attrs="{'invisible': [('use_template_approver', '=', '1')]}"/>
                <field name="notifyer" attrs="{'invisible': [('use_template_approver', '=', '1')]}"/>
                <field name="notify_type" attrs="{'invisible': [('use_template_approver', '=', '1')]}"/>
                <field name="summary_info_ids"/>
<!--                 <button name="submit" type="object" string="提交" class="btn-success"/> -->
            </group>
            </form>
		</field>
	</record>

    <record model="ir.ui.view" id="we_approval_template_kanban">
        <field name="name">审批模板</field>
        <field name="model">wxwork.approval.template</field>
        <field name="arch" type="xml">
            <kanban class="o_kanban_mobile" js_class="we_approval_tem_kanban_class">
                <field name="company_id"/>
                <field name="name"/>
                <templates>
                    <t t-name="kanban-box">
                        <div class="oe_kanban_global_click o_kanban_record_has_image_fill oe_module_vignette">
                            <div class="oe_kanban_details">
                                <div class="o_kanban_record_top">
                                    <div class="o_kanban_record_headings">
                                        <strong class="o_kanban_record_title">
                                            <field name="name"/>
                                        </strong>
                                    </div>
                                </div>
<!--                                 <field name="company_id" options="{'color_field': 'color'}"/> -->
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

    <record id="wxwork_approval_template_controls_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件</field>
        <field name="model">wxwork.approval.template.controls</field>
        <field name="arch" type="xml">
            <tree default_order="id desc" js_class="we_approval_tem_tree_class">
                <field name="template_id"/>
                <field name="property_id" widget="many2many_tags"/>
                <field name="config_id"/>
            </tree>
        </field>
    </record>
    <record id="wxwork_approval_template_controls_form" model="ir.ui.view">
		<field name="name">审批模板控件</field>
		<field name="model">wxwork.approval.template.controls</field>
		<field name="arch" type="xml">
            <form>
            <group>
                <field name="template_id"/>
                <field name="property_id"/>
                <field name="config_id"/>
            </group>
            </form>
		</field>
	</record>
<!--     审批模板控件属性 -->
    <record id="property_model_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件属性</field>
        <field name="model">property.model</field>
        <field name="arch" type="xml">
            <tree>
                <field name="title"/>
<!--                 <field name="control_id"/> -->
                <field name="unique_control_id"/>
                <field name="control_type"/>
                <field name="placeholder"/>
                <field name="require"/>
                <field name="un_print"/>
                <field name="un_replace"/>
                <field name="display"/>
            </tree>
        </field>
    </record>
    <record id="property_model_form" model="ir.ui.view">
		<field name="name">审批模板控件属性</field>
		<field name="model">property.model</field>
		<field name="arch" type="xml">
            <form>
            <group>
                <field name="title"/>
<!--                 <field name="control_id"/> -->
                <field name="unique_control_id"/>
                <field name="control_type"/>
                <field name="placeholder"/>
                <field name="require"/>
                <field name="un_print"/>
                <field name="un_replace"/>
                <field name="display"/>
            </group>
            </form>
		</field>
	</record>

	<!--     审批模板控件配置 -->
    <record id="config_model_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件配置</field>
        <field name="model">config.model</field>
        <field name="arch" type="xml">
            <tree>
                <field name="control_id"/>
                <field name="date_type"/>
                <field name="selector_type"/>
                <field name="contact_type"/>
                <field name="table_type"/>
                <field name="attendance_type"/>
                <field name="file_type"/>

<!--                 <field name="options"/> -->
<!--                 <field name="contact_type"/> -->
<!--                 <field name="contact_mode"/> -->
<!--                 <field name="table_children"/> -->
<!--                 <field name="attendance_type"/> -->
<!--                 <field name="attendance_date_range_type"/> -->
<!--                 <field name="vacation_list"/> -->
            </tree>
        </field>
    </record>
    <record id="config_model_form" model="ir.ui.view">
		<field name="name">审批模板控件配置</field>
		<field name="model">config.model</field>
		<field name="arch" type="xml">
            <form>
            <group>
                <field name="control_id"/>
                <field name="date_type"/>
                <field name="selector_type"/>
                <field name="contact_type"/>
                <field name="table_type"/>
                <field name="attendance_type"/>
                <field name="file_type"/>
<!--                 <field name="date_type"/> -->
<!--                 <field name="selector_type"/> -->
<!--                 <field name="options"/> -->
<!--                 <field name="contact_type"/> -->
<!--                 <field name="contact_mode"/> -->
<!--                 <field name="table_children"/> -->
<!--                 <field name="attendance_type"/> -->
<!--                 <field name="attendance_date_range_type"/> -->
<!--                 <field name="vacation_list"/> -->
            </group>
            </form>
		</field>
	</record>

    <!--     审批模板控件Date控件config配置 -->
    <record id="config_model_date_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Date控件config配置</field>
        <field name="model">wxwork.approval.date.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="date_type"/>
            </tree>
        </field>
    </record>
    <record id="config_model_date_form" model="ir.ui.view">
        <field name="name">审批模板控件Date控件config配置</field>
        <field name="model">wxwork.approval.date.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="date_type"/>
            </group>
            </form>
        </field>
    </record>
    <!--     审批模板控Selector控件（单选/多选控件）config配置 -->
    <record id="config_model_selector_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Selector控件（单选/多选控件）config配置</field>
        <field name="model">wxwork.approval.selector.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="selector_type"/>
                <field name="selector_exp_type"/>
                <field name="options"/>
            </tree>
        </field>
    </record>
    <record id="config_model_selector_form" model="ir.ui.view">
        <field name="name">审批模板控件Selector控件（单选/多选控件）config配置</field>
        <field name="model">wxwork.approval.selector.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="selector_type"/>
                <field name="selector_exp_type"/>
                <field name="options"/>
            </group>
            </form>
        </field>
    </record>
    <!--     审批模板控Selector控件（单选/多选控件）选项配置 -->
    <record id="config_model_selector_options_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Selector控件（单选/多选控件）选项配置</field>
        <field name="model">selector.option</field>
        <field name="arch" type="xml">
            <tree>
                <field name="key"/>
                <field name="text"/>
                <field name="lang"/>
            </tree>
        </field>
    </record>
    <record id="config_model_selector_options_form" model="ir.ui.view">
        <field name="name">审批模板控件Selector控件（单选/多选控件）选项配置</field>
        <field name="model">selector.option</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="key"/>
                <field name="text"/>
                <field name="lang"/>
            </group>
            </form>
        </field>
    </record>
    <!--     审批模板控件Contact控件（成员/部门/标签控件）config配置 -->
    <record id="config_model_contact_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Contact控件（成员/部门/标签控件）config配置</field>
        <field name="model">wxwork.approval.contact.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="contact_type"/>
                <field name="contact_mode"/>
            </tree>
        </field>
    </record>
    <record id="config_model_contact_form" model="ir.ui.view">
        <field name="name">审批模板控件Contact控件（成员/部门/标签控件）config配置</field>
        <field name="model">wxwork.approval.contact.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="contact_type"/>
                <field name="contact_mode"/>
            </group>
            </form>
        </field>
    </record>
    <!--     审批模板控件Table控件（明细控件）config配置 -->
    <record id="config_model_table_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Table控件（明细控件）config配置</field>
        <field name="model">wxwork.approval.table.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="table_children"/>
                <field name="table_children_config"/>
            </tree>
        </field>
    </record>
    <record id="config_model_table_form" model="ir.ui.view">
        <field name="name">审批模板控件Table控件（明细控件）config配置</field>
        <field name="model">wxwork.approval.table.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="table_children"/>
                <field name="table_children_config"/>

            </group>
            </form>
        </field>
    </record>
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="children_name"/> -->
<!--                 <field name="children_control"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="children_name"/> -->
<!--                 <field name="children_control"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_control_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="control_type"/> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_control_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="control_type"/> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_control_required_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="required_name"/> -->
<!--                 <field name="required_control"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_control_required_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="required_name"/> -->
<!--                 <field name="required_control"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_control_required_control_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_control_required_control_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_control_required_control_required_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.required.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="required_name"/> -->
<!--                 <field name="required_control"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_control_required_control_required_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.required.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="required_name"/> -->
<!--                 <field name="required_control"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->
<!--      --><!--     审批模板控件Table控件（明细控件）子控件配置 -->
<!--     <record id="config_model_table_children_control_required_control_required_control_tree_view" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.required.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <tree> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </tree> -->
<!--         </field> -->
<!--     </record> -->
<!--     <record id="config_model_table_children_control_required_control_required_control_form" model="ir.ui.view"> -->
<!--         <field name="name">审批模板控件Table控件（明细控件）子控件配置</field> -->
<!--         <field name="model">wxwork.approval.table.children.control.required.control.required.control.config</field> -->
<!--         <field name="arch" type="xml"> -->
<!--             <form> -->
<!--             <group> -->
<!--                 <field name="control_name"/> -->
<!--                 <field name="control_required"/> -->
<!--             </group> -->
<!--             </form> -->
<!--         </field> -->
<!--     </record> -->

<!--     审批模板控件Attendance控件（假勤控件）config配置 -->
    <record id="config_model_attendance_control_config_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Attendance控件（假勤控件）config配置</field>
        <field name="model">wxwork.approval.attendance.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="attendance_type"/>
                <field name="attendance_date_range_type"/>
            </tree>
        </field>
    </record>
    <record id="config_model_attendance_control_config_form" model="ir.ui.view">
        <field name="name">审批模板控件Attendance控件（假勤控件）config配置</field>
        <field name="model">wxwork.approval.attendance.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="attendance_type"/>
                <field name="attendance_date_range_type"/>
            </group>
            </form>
        </field>
    </record>
        <!--    审批模板控件Vacation控件（假勤控件）config配置 -->
    <record id="config_model_vacation_control_config_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件Vacation控件（假勤控件）config配置</field>
        <field name="model">wxwork.approval.vacation.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="vacation_id"/>
                <field name="name"/>
                <field name="lang"/>
            </tree>
        </field>
    </record>
    <record id="config_model_vacation_control_config_form" model="ir.ui.view">
        <field name="name">审批模板控件Vacation控件（假勤控件）config配置</field>
        <field name="model">wxwork.approval.vacation.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="vacation_id"/>
                <field name="name"/>
                <field name="lang"/>
            </group>
            </form>
        </field>
    </record>
<!--     审批模板控件file控件（文件控件）config配置 -->
    <record id="config_model_file_control_config_tree_view" model="ir.ui.view">
        <field name="name">审批模板控件file控件（文件控件）config配置</field>
        <field name="model">wxwork.approval.file.config</field>
        <field name="arch" type="xml">
            <tree>
                <field name="is_only_photo"/>

            </tree>
        </field>
    </record>
    <record id="config_model_file_control_config_form" model="ir.ui.view">
        <field name="name">审批模板控件file控件（文件控件）config配置</field>
        <field name="model">wxwork.approval.file.config</field>
        <field name="arch" type="xml">
            <form>
            <group>
                <field name="is_only_photo"/>
            </group>
            </form>
        </field>
    </record>








    <record id="we_approval_template_action" model="ir.actions.act_window">
        <field name="name">审批模板</field>
        <field name="res_model">wxwork.approval.template</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                请创建模板，填写模板id然后点击获取模板详情！！！
            </p>
        </field>
    </record>

    <record id="wxwork_approval_template_controls_action" model="ir.actions.act_window">
        <field name="name">审批模板控件</field>
        <field name="res_model">wxwork.approval.template.controls</field>
        <field name="view_mode">tree,kanban,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                请创建模板控件！！！
            </p>
        </field>
    </record>

<!--     <menuitem id="we_approval_template_menu" name="审批模板" parent="menu_wechat_enterprise_contact" sequence="105" -->
<!--               action="we_approval_template_action"/>     -->
    <menuitem id="we_approval_template_menu" name="审批模板" parent="menu_wxwork_approval" sequence="10"
              action="we_approval_template_action"/>
    <menuitem id="we_approval_template_controls_menu" name="审批模板控件" parent="menu_wxwork_approval" sequence="20"
              action="wxwork_approval_template_controls_action"/>

</odoo>
