Files
odoo_source/addons/mail/views/ir_actions_server_views.xml
T
0a744accc2 [IMP] base_automation,*: simpler edition workflow
*: base, crm, digest, mail, mass_mailing, sms, test_base_automation,
   website_forum, website_sale

This commit makes "Automated Actions" more discoverable and usable by:

- Adding a menu in the kanban header config dropdown to add/edit them.
- Creating a new custom kanban view for a clear understanding of each
  automated action record and its associated actions.
- Introducing new "smart" triggers that appear in the form view based on the
  chosen model:
  - Updated Values category:
    - "Stage is set to" when a `stage_id` field exists in the model,
      allowing users to select a specific stage value.
    - "State is set to" when a `state` field exists in the model,
      allowing users to select a specific state value.
    - "Priority is set to" (`priority`) where users can select a specific priority.
    - "User is set" (`user_id`, `user_ids` fields)
    - "Tag is added" (`tag_ids` field) where users can select a specific tag.
    - "On Archive"
    - "On Unarchive"
  - Timing Conditions:
    - "After creation"
    - "After last update"
- Deprecating previously known triggers "On Creation" (`on_create`) and "On
  Update" (`on_write`) to simplify the user experience. "On Creation & Update"
  (`on_create_or_write`) is retained and renamed to "On save".
- Changing the `ir.actions.server` Many2one relationship to a One2many
  relationship. Automated actions can now directly contain multiple actions,
  eliminating the need for an "Execute several actions" action in automation
  rules.
- Introducing a widget for the new `ir.actions.server` One2many field for a
  clearer understanding of multiple actions.

This commit also enhances the usability of "Server Actions" (`ir.actions`) by:

- Removing the `ir.server.object.lines` model and the associated `fields_lines`
  One2Many field. The attributes of the removed model are now merged into
  `ir.actions`. An action can now write to only one field, and the create action
  is now a name_create action.
- Adapting the form view when creating an "Update the record" action. The value
  field shown adapts itself based on the field to update; this field can be a
  `reference` field for a `one2many` `update_field_id`, a `one2many` field for a
  selection `update_field_id`, or a `text` field otherwise.
- Refactoring the form view to display only relevant details and other
  miscellaneous improvements.

Taskid: 3085360
Part-of: odoo/odoo#114352
Co-authored-by: Florent Dardenne <dafl@odoo.com>
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
2023-09-05 18:44:13 +00:00

65 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="view_server_action_form_template">
<field name="name">ir.actions.server.form</field>
<field name="model">ir.actions.server</field>
<field name="inherit_id" ref="base.view_server_action_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='action_content']" position="inside">
<field name="activity_type_id" options="{'no_create': True, 'no_open': True}"
required="state == 'next_activity'" invisible="state != 'next_activity'"/>
<field name="activity_summary" placeholder="e.g. Discuss proposal" invisible="state != 'next_activity'"/>
</xpath>
<xpath expr="//group[@name='action_content']" position="after">
<group invisible="state != 'next_activity'">
<label for="activity_date_deadline_range"/>
<div class="o_row">
<field name="activity_date_deadline_range" class="oe_inline"/>
<field name="activity_date_deadline_range_type" class="oe_inline" required="state == 'next_activity' and activity_date_deadline_range &gt; 0"/>
</div>
<field name="activity_user_type" required="state == 'next_activity'"/>
<field name="activity_user_field_name" placeholder="e.g. user_id" invisible="activity_user_type == 'specific'" required="state == 'next_activity' and activity_user_type == 'generic'"/>
<field name="activity_user_id" placeholder="Select a user..." invisible="activity_user_type == 'generic'" required="state == 'next_activity' and activity_user_type == 'specific'"/>
</group>
<field name="activity_note" class="oe-bordered-editor" placeholder="Add a description to your activity..." invisible="state != 'next_activity'"/>
</xpath>
<xpath expr="//field[@name='link_field_id']" position="after">
<field name="partner_ids" string="Followers to add" widget="many2many_tags"
invisible="state != 'followers'"
required="state == 'followers'"/>
<field name="partner_ids" string="Followers to remove" widget="many2many_tags"
invisible="state != 'remove_followers'"
required="state == 'remove_followers'"/>
<field name="template_id"
invisible="state != 'mail_post'"
required="state == 'mail_post'"
context="{'default_model': model_name,
'default_use_default_to': True}"/>
<label for="mail_post_method" invisible="state != 'mail_post'"/>
<div class="d-flex flex-column" invisible="state != 'mail_post'">
<field name="mail_post_method" required="state == 'mail_post'"/>
<div class="text-muted">
<span invisible="mail_post_method != 'email'">
The message will be sent as an email to the recipients of the
template and will not appear in the messaging history.
</span>
<span invisible="mail_post_method != 'note'">
The message will be posted as an internal note visible to internal
users in the messaging history.
</span>
<span invisible="mail_post_method != 'comment'">
The message will be posted as a message on the record,
notifying all followers. It will appear in the messaging history.
</span>
</div>
</div>
<field name="mail_post_autofollow" invisible="1"/>
</xpath>
</field>
</record>
</data>
</odoo>