1 <?xml version="1.0" encoding="utf-8"?>
4 <menuitem id="base.menu_base_action_rule_admin" name="Automated Actions"
5 parent="base.menu_custom" />
7 <!-- Action Rule Form View -->
8 <record id="view_base_action_rule_form" model="ir.ui.view">
9 <field name="name">base.action.rule.form</field>
10 <field name="model">base.action.rule</field>
11 <field name="arch" type="xml">
12 <form string="Action Rule" version="7.0">
14 <label for="name" class="oe_edit_only"/>
15 <h1><field name="name"/></h1>
18 <field name="model_id" on_change="onchange_model_id(model_id, context)"/>
19 <field name="model" invisible="1"/>
22 <field name="active"/>
23 <field name="sequence"/>
27 <page string="Conditions">
29 <field name="kind" required="1"
30 on_change="onchange_kind(kind)"/>
31 <field name="filter_pre_id"
32 domain="[('model_id','=',model), ('user_id', '=', False)]"
33 context="{'default_model_id': model}"
34 attrs="{'invisible': [('kind', '!=', 'on_write')]}"/>
35 <field name="filter_id"
36 domain="[('model_id','=',model), ('user_id', '=', False)]"
37 context="{'default_model_id': model}"/>
38 <field name="trg_date_id"
39 attrs="{'invisible': [('kind', '!=', 'on_time')], 'required': [('kind', '=', 'on_time')]}"/>
40 <label for="trg_date_range" string="Delay After Trigger Date"
41 attrs="{'invisible': [('trg_date_id','=',False)]}"/>
42 <div attrs="{'invisible': [('trg_date_id','=',False)]}">
43 <field name="trg_date_range" class="oe_inline"/>
44 <field name="trg_date_range_type" class="oe_inline" attrs="{'required': [('trg_date_id','!=',False)]}"/>
46 <field name="trg_date_calendar_id" class="oe_inline"
47 attrs="{'invisible': ['|', ('trg_date_id','=',False), ('trg_date_range_type', '!=', 'day')]}"/>
50 Select when the action must be run, and add filters and/or timing conditions.
52 In order to create a new filter:
54 <li>Go to your "Related Document Model" page and set the filter parameters in the "Search" view (Example of filter based on Leads/Opportunities: Creation Date "is equal to" 01/01/2012)</li>
55 <li>In this same "Search" view, select the menu "Save Current Filter", enter the name (Ex: Create the 01/01/2012) and add the option "Share with all users"</li>
57 The filter must therefore be available in this page.
60 <page string="Actions">
61 <group name="action_field" col="4" string="Fields to Change">
62 <field name="act_user_id"/>
63 <field name="act_followers" widget="many2many_tags"/>
65 <group name="action_server" string="Server actions to run">
66 <field name="server_action_ids" domain="[('model_id','=', model_id)]" nolabel="1" context="{'default_model_id': model_id}">
67 <tree string="Server Actions">
68 <field name="sequence"/>
81 <!-- Action Rule Tree View -->
82 <record id="view_base_action_rule_tree" model="ir.ui.view">
83 <field name="name">base.action.rule.tree</field>
84 <field name="model">base.action.rule</field>
85 <field name="arch" type="xml">
86 <tree string="Action Rule">
87 <field name="sequence"/>
90 <field name="filter_id"/>
95 <!-- Action Rule Action -->
96 <record id="base_action_rule_act" model="ir.actions.act_window">
97 <field name="name">Automated Actions</field>
98 <field name="res_model">base.action.rule</field>
99 <field name="view_type">form</field>
100 <field name="view_mode">tree,form</field>
101 <field name="view_id" ref="view_base_action_rule_tree"/>
102 <field name="help" type="html">
103 <p class="oe_view_nocontent_create">
104 Click to setup a new automated action rule.
106 Use automated actions to automatically trigger actions for
107 various screens. Example: a lead created by a specific user may
108 be automatically set to a specific sales team, or an
109 opportunity which still has status pending after 14 days might
110 trigger an automatic reminder email.
115 <menuitem id="menu_base_action_rule_form"
116 parent="base.menu_base_action_rule_admin" action="base_action_rule_act" sequence="1"/>