327 lines
18 KiB
XML
327 lines
18 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<record id="view_form_soong_workflow_node" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.form</field>
|
|
<field name="model">soong.workflow.node</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<sheet>
|
|
<field name="workflow_id" invisible="1"/>
|
|
<field name="model_id" invisible="1"/>
|
|
<group>
|
|
<group>
|
|
<field name="name" placeholder="ex. 'Draft' or 'Direct Manager'" required="1"/>
|
|
<field name="node_name" placeholder="ex. 'draft' or 'direct_manager'" required="1"/>
|
|
<field name="department_id" widget="many2many_tags"/>
|
|
<field name="transfer_comment_id"/>
|
|
<field name="return_comment_id"/>
|
|
<field name="confirm_comment_id"/>
|
|
<field name="end_comment_id"/>
|
|
<field name="is_mandatory_node"/>
|
|
<field name="same_user_skip_type"/>
|
|
<field name="illustrate"/>
|
|
</group>
|
|
<group>
|
|
<field name="sequence" required="1"/>
|
|
<field name="is_visible"/>
|
|
</group>
|
|
<group>
|
|
<div>
|
|
<label for="use_custom_colors"/>
|
|
<field name="use_custom_colors" class="oe_inline"/>
|
|
</div>
|
|
<group invisible="use_custom_colors == True">
|
|
<field name="res_bg_color" widget="color"/>
|
|
<field name="res_label_color" widget="color"/>
|
|
</group>
|
|
<group invisible="use_custom_colors == False">
|
|
<field name="bg_color" widget="color"/>
|
|
<field name="label_color" widget="color"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="flow_start"/>
|
|
<field name="flow_end" invisible="1"/>
|
|
<field name="is_apostille"/>
|
|
<field name="is_end"/>
|
|
<field name="is_confirm"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="approval_concatenation" widget="radio"/>
|
|
</group>
|
|
<notebook>
|
|
<page string="Buttons">
|
|
<button name="btn_role_sync"
|
|
string="角色同步"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<field name="button_ids" mode="tree" context="{'default_node_id':id}"/>
|
|
</page>
|
|
<page string="Fields">
|
|
<button name="btn_load_fields"
|
|
string="加载模型字段-form"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<button name="all_readonly_fields"
|
|
string="全部只读"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<button name="all_required_fields"
|
|
string="全部必填"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<button name="all_invisible_fields"
|
|
string="全部隐藏"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<button name="all_false_fields"
|
|
string="全部还原"
|
|
type="object"
|
|
class="oe_highlight"/>
|
|
<field name="field_ids" mode="tree"
|
|
context="{'default_model_id':model_id, 'disable_open': 1}"/>
|
|
</page>
|
|
<page string="Links">
|
|
<separator string="Outgoing Links"/>
|
|
<field name="out_link_ids" mode="tree"/>
|
|
<separator string="Ingoing Links"/>
|
|
<field name="in_link_ids" mode="tree"/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_tree_soong_workflow_node" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.tree</field>
|
|
<field name="model">soong.workflow.node</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="name"/>
|
|
<field name="is_visible"/>
|
|
<field name="flow_start"/>
|
|
<field name="flow_end"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_form_soong_workflow_node_field" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.field.form</field>
|
|
<field name="model">soong.workflow.node.field</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<sheet>
|
|
<group>
|
|
<group string="Main Information">
|
|
<field name="model_id" invisible="1"/>
|
|
<field name="name" required="1" domain="[('model_id','=',model_id)]"/>
|
|
</group>
|
|
<group string="Attributes">
|
|
<field name="readonly"/>
|
|
<field name="required"/>
|
|
<field name="invisible"/>
|
|
</group>
|
|
</group>
|
|
<group string="Groups">
|
|
<field name="group_ids" nolabel="1" mode="tree" context="{'disable_open': 1}"/>
|
|
</group>
|
|
<group string="Users">
|
|
<field name="user_ids" nolabel="1" mode="tree" context="{'disable_open': 1}"/>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record id="view_tree_soong_workflow_node_field" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.field.tree</field>
|
|
<field name="model">soong.workflow.node.field</field>
|
|
<field name="arch" type="xml">
|
|
<tree editable="bottom">
|
|
<field name="model_id" invisible="1"/>
|
|
<field name="name" required="1" domain="[('model_id','=',model_id)]"/>
|
|
<field name="readonly"/>
|
|
<field name="required"/>
|
|
<field name="invisible"/>
|
|
<field name="group_ids" widget="many2many_tags"/>
|
|
<field name="user_ids" widget="many2many_tags"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_form_soong_workflow_node_button" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.button.form</field>
|
|
<field name="model">soong.workflow.node.button</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<field name="workflow_id" invisible="0"/>
|
|
<field name="invisible_expression_model" invisible="1"/>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="sequence" required="1"/>
|
|
<field name="name" required="1"/>
|
|
<field name="is_highlight"/>
|
|
<!-- <field name="is_high_red"/>-->
|
|
<field name="has_comment" invisible="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="node_id" options="{'no_open': True, 'no_create': True}"
|
|
domain="[('workflow_id','=',workflow_id)]"/>
|
|
<field name="has_icon"/>
|
|
<field name="icon" invisible="has_icon == False" required="has_icon == True"/>
|
|
</group>
|
|
<group col="2">
|
|
<group>
|
|
<field name="is_review_invisible"/>
|
|
<field name="invisible_expression" colspan="2" invisible="is_review_invisible == False"
|
|
required="is_review_invisible == True"
|
|
widget="domain"
|
|
options="{'model': 'invisible_expression_model', 'in_dialog': True,}"
|
|
nolabel="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="illustrate"/>
|
|
</group>
|
|
</group>
|
|
</group>
|
|
<group col="3">
|
|
<group>
|
|
<field name="is_automatic"/>
|
|
<field name="is_automatic_company"/>
|
|
<field name="is_automatic_group"/>
|
|
</group>
|
|
<group>
|
|
<field name="is_logged_by"/>
|
|
<field name="is_logged_company"/>
|
|
<field name="is_logged_group"/>
|
|
</group>
|
|
<group>
|
|
<field name="is_dep"/>
|
|
<field name="role_id" invisible="not is_dep"/>
|
|
<separator string="按指定字段匹配"/>
|
|
<field name="specify_field_id" domain="[('ttype', '=', 'many2one'), ('model', '=', invisible_expression_model)]"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<field name="is_node_automatic"/>
|
|
<field name="is_carbon_copy"/>
|
|
<field name="user_role_ids" widget="many2many_tags" invisible="not is_carbon_copy"
|
|
options="{'no_create': True}"/>
|
|
<field name="users_role_group_ids" widget="many2many_tags" invisible="not is_carbon_copy"
|
|
options="{'no_create': True}"/>
|
|
<field name="department1_ids" widget="many2many_tags" invisible="not is_carbon_copy"
|
|
options="{'no_create': True}"/>
|
|
<field name="employee_ids" widget="many2many_tags" invisible="not is_carbon_copy"
|
|
options="{'no_create': True}"/>
|
|
</group>
|
|
<notebook>
|
|
<page string="Condition">
|
|
<group>
|
|
<field name="btn_hide"/>
|
|
</group>
|
|
<group invisible="btn_hide == False">
|
|
<field name="review_type" string="审批类型"/>
|
|
<field name="reviewer_id" invisible="review_type != 'individual'"/>
|
|
<field name="reviewer_group_id" invisible="review_type != 'group'"/>
|
|
<field name="users_role_id" invisible="review_type != 'user_role'"/>
|
|
<field name="users_role_group_ids" invisible="review_type != 'user_role'"
|
|
widget="many2many_tags"/>
|
|
</group>
|
|
<group invisible="review_type != 'expression' or btn_hide == False">
|
|
<div class="alert alert-danger oe_edit_only" role="alert" style="width: max-content;">
|
|
<strong>Note:</strong>
|
|
The result of executing the expression must be a res.users recordset.
|
|
</div>
|
|
<field name="reviewer_expression" colspan="2" required="review_type == 'expression'"
|
|
widget="code"
|
|
options="{'mode': 'python'}" nolabel="1"/>
|
|
</group>
|
|
<!-- <group invisible="review_type != 'invisible' or btn_hide == False">-->
|
|
<!-- <field name="invisible_expression" colspan="2" required="review_type == 'invisible'"-->
|
|
<!-- widget="domain"-->
|
|
<!-- options="{'model': 'invisible_expression_model', 'in_dialog': True,}"-->
|
|
<!-- nolabel="1"/>-->
|
|
<!-- </group>-->
|
|
</page>
|
|
<page string="Actions">
|
|
<group>
|
|
<field name="action_type" required="1"/>
|
|
</group>
|
|
<group name="link"
|
|
invisible="action_type not in ['link', 'link_action', 'link_action_approve', 'link_action_refuse', 'link_start_statu']">
|
|
<field name="link_id"
|
|
domain="[('node_from','=',node_id)]"
|
|
options="{'no_open': True, 'no_create': True}"
|
|
required="action_type == 'link'"/>
|
|
</group>
|
|
<group name="code" invisible="action_type != 'code'">
|
|
<field name="code" widget="code" options="{'mode': 'python'}"
|
|
required="action_type == 'code'"/>
|
|
</group>
|
|
<group name="action" invisible="action_type != 'action'">
|
|
<field name="server_action_id"
|
|
context="{'default_is_workflow':True}"
|
|
options="{'no_open': True, 'no_create': True}"
|
|
required="action_type == 'action'"/>
|
|
</group>
|
|
<group name="win_action" invisible="action_type != 'win_act'">
|
|
<field name="win_act_id" options="{'no_open': True, 'no_create': True}"
|
|
required="action_type == 'win_act'"/>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record id="view_tree_soong_workflow_node_button" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.button.tree</field>
|
|
<field name="model">soong.workflow.node.button</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="name"/>
|
|
<field name="illustrate"/>
|
|
<field name="is_highlight" column_invisible="1"/>
|
|
<field name="node_id" column_invisible="1"/>
|
|
<field name="users_role_id"/>
|
|
<field name="users_role_group_ids" widget="many2many_tags"/>
|
|
<field name="reviewer_id" string="用户"/>
|
|
<field name="action_type"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<record id="view_tree_soong_workflow_node_button1" model="ir.ui.view">
|
|
<field name="name">soong.workflow.node.button.tree</field>
|
|
<field name="model">soong.workflow.node.button</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="workflow_id"/>
|
|
<field name="name"/>
|
|
<field name="node_id"/>
|
|
<field name="action_type"/>
|
|
<field name="users_role_id"/>
|
|
<field name="users_role_group_ids" widget="many2many_tags"/>
|
|
<field name="reviewer_id" string="用户"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<record id="view_soong_workflow_node_button_action" model="ir.actions.act_window">
|
|
<field name="name">soong.workflow.node.button</field>
|
|
<field name="res_model">soong.workflow.node.button</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="view_id" ref="view_tree_soong_workflow_node_button1"/>
|
|
</record>
|
|
<record id="all_update_user_id" model="ir.actions.server">
|
|
<field name="name">初始化用户</field>
|
|
<field name="model_id" ref="soong_workflow.model_soong_workflow_node_button"/>
|
|
<field name="binding_model_id" ref="soong_workflow.model_soong_workflow_node_button"/>
|
|
<field name="state">code</field>
|
|
<field name="code">action = model.update_user_id()</field>
|
|
</record>
|
|
</odoo>
|