1 <?xml version="1.0" encoding="utf-8"?>
4 <menuitem id="menu_base_action_rule" name="Action Rule" parent="base.menu_base_config" sequence="0"/>
9 <record id="view_base_action_rule_form" model="ir.ui.view">
10 <field name="name">base.action.rule.form</field>
11 <field name="model">base.action.rule</field>
12 <field name="type">form</field>
13 <field name="arch" type="xml">
14 <form string="Action Rule">
15 <field name="name" select="1"/>
16 <field name="active"/>
17 <field name="max_level" />
18 <separator colspan="4" string="Rule lines"/>
19 <field name="rule_lines" colspan="4" nolabel="1"/>
24 <record id="view_base_action_rule_tree" model="ir.ui.view">
25 <field name="name">base.action.rule.tree</field>
26 <field name="model">base.action.rule</field>
27 <field name="type">tree</field>
28 <field name="arch" type="xml">
29 <tree string="Action Rule">
30 <field name="name" colspan="4"/>
31 <field name="max_level"/>
32 <field name="rule_lines" colspan="4" nolabel="1"/>
37 <record id="base_action_rule_act" model="ir.actions.act_window">
38 <field name="name">Action Rules</field>
39 <field name="res_model">base.action.rule</field>
40 <field name="view_type">form</field>
41 <field name="view_mode">tree,form</field>
42 <field name="view_id" ref="view_base_action_rule_tree"/>
45 <menuitem id="menu_base_action_rule_form" parent="menu_base_action_rule" action="base_action_rule_act"/>
50 <record id="view_base_action_rule_line_form" model="ir.ui.view">
51 <field name="name">base.action.rule.line.form</field>
52 <field name="model">base.action.rule.line</field>
53 <field name="type">form</field>
54 <field name="arch" type="xml">
55 <form string="Action Rule Line">
56 <field name="name" select="1"/>
57 <field name="active" select="2"/>
58 <notebook colspan="4">
59 <page string="Conditions">
60 <group col="2" colspan="2" name="model">
61 <separator colspan="4" string="Conditions on Model Fields"/>
62 <field name="regex_name" string="Regex on Model Name" colspan="2"/>
63 <field name="trg_user_id" select="2"/>
65 <group col="2" colspan="2" name="partner">
66 <separator colspan="4" string="Conditions on Model Partner"/>
67 <field name="trg_partner_id"/>
68 <field name="trg_partner_categ_id"/>
70 <group col="2" colspan="2">
71 <separator colspan="4" string="Conditions on States"/>
72 <field name="trg_state_from" select="2"/>
73 <field name="trg_state_to" select="2"/>
75 <group col="2" colspan="2">
76 <separator colspan="4" string="Conditions on Priority Range"/>
77 <field name="trg_priority_from"/>
78 <field name="trg_priority_to"/>
80 <group col="2" colspan="2">
81 <separator colspan="4" string="Conditions on Timing"/>
82 <field name="trg_date_type"/>
83 <label align="1.0" string="Delay After Trigger Date:"/>
84 <group col="2" colspan="1">
85 <field name="trg_date_range" nolabel="1"/>
86 <field name="trg_date_range_type" nolabel="1"/>
89 <separator colspan="4" string="Note"/>
90 <label align="0.0" string="The rule use a AND operator. The model must match all non empty fields so that the rule execute the action described in the 'Actions' tab." colspan="4"/>
92 <page string="Actions">
93 <separator colspan="4" string="Fields to Change"/>
94 <field name="act_user_id"/>
95 <field name="act_state"/>
96 <field name="act_priority"/>
97 <separator colspan="4" string="E-Mail Reminders (includes the content of the object)"/>
98 <field name="act_remind_partner"/>
99 <field name="act_remind_attach"/>
100 <field name="act_remind_user"/>
101 <group col="2" colspan="2" attrs="{'invisible': [('act_remind_user','=',False)]}">
102 <field name="act_reply_to" attrs="{'required':[('act_remind_user','=',True)]}"/>
104 <field colspan="4" name="act_email_cc"/>
105 <separator colspan="4" string="Server Action to be Triggered"/>
106 <field name="server_action_id"/>
108 <page string="E-Mail Actions">
109 <separator colspan="4" string="Template of Email to Send"/>
110 <field name="act_mail_to_user"/>
111 <field name="act_mail_to_watchers"/>
112 <field colspan="4" name="act_mail_to_email"/>
113 <field colspan="4" name="act_mail_body" attrs="{'required':[('act_remind_user','=',True)]}"/>
114 <separator colspan="4" string="Special Keywords to Be Used in The Body"/>
115 <label align="0.0" string="%%(object_id)s = Object ID" colspan="2"/>
116 <label align="0.0" string="%%(object_subject)s = Object subject" colspan="2"/>
117 <label align="0.0" string="%%(object_description)s = Object description" colspan="2"/>
118 <label align="0.0" string="%%(object_date)s = Creation date" colspan="2"/>
119 <label align="0.0" string="%%(partner)s = Partner name" colspan="2"/>
120 <label align="0.0" string="%%(partner_email)s = Partner email" colspan="2"/>
121 <label align="0.0" string="%%(object_user)s = Responsible name" colspan="2"/>
122 <label align="0.0" string="%%(object_user_email)s = Responsible email" colspan="2"/>
123 <label align="0.0" string="%%(object_user_phone)s = Responsible phone" colspan="2"/>
124 <label align="0.0" string="%% = The '%%' Character" colspan="2"/>
130 <record id="view_base_action_rule_line_tree" model="ir.ui.view">
131 <field name="name">base.action.rule.line.tree</field>
132 <field name="model">base.action.rule.line</field>
133 <field name="type">tree</field>
134 <field name="arch" type="xml">
135 <tree string="Action Rule Lines">
137 <field name="active"/>
143 domain="[('rule_id', '=', active_id)]"
144 id="act_rule_lines_open"
145 name="Open Rule Lines"
146 context="{'rule_id': active_id}"
147 res_model="base.action.rule.line"
148 src_model="base.action.rule"/>