We add the option to keep the completed activities to allow the user to keep track of the past action, especially the uploaded files which are displayed along the completed activities. This feature can be activated per activity type and is disabled by default. We also improve the activity view to give a better overview of what has been done and what is still to be done and by whom. We also add tests for those new features: - check activity data for the views (server-side test) * Details about the activity view improvements: ** Improvement of the column header: - progressbar: previously, only visible activities were counted in the progression bar. Now all are counted. - activity counter: instead of displaying the total count (next to the progression bar), we display now a ratio as 2 numbers (only if keep done is enabled): ** Improvement of the activity cells: - add assignees in activity cells of activity view (limit to 2 having the activity with closest deadline, if more a + is displayed). Note: to avoid spacing between avatar, we add the optional props noSpacing to the avatar component. - add done activity in activity cell popover - increase by 50% the popover height - display done activity cell in grey - instead of displaying the activity count if greater than 1, we display a ratio ongoing / activity count. Note: we don't display the denominator if all activities are done or all are ongoing. ** Progress bar filter The activity filter is slighly modified. Previously, when clicking on a color of the progress bar, all cell with a different color where hidden (ex.: if we were clicking on the green area to filter planned activities, red cell which represents overdue activities were hidden even if there was also a planned activities for this record and activity type). Now we also display cells with other "color" if there exist for that record and that type an activity corresponding to the filtered "color". Technical note: mail_activity.get_activity_data returns now for the activity types a list of dictionary instead of a list of list. This simplifies the reading as we can now uses name instead of index (type[1] becomes type.name for example). Task-3300854 Part-of: odoo/odoo#138135
266 lines
15 KiB
XML
266 lines
15 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
<record id="mail_activity_type_view_form" model="ir.ui.view">
|
|
<field name="name">mail.activity.type.view.form</field>
|
|
<field name="model">mail.activity.type</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Activities">
|
|
<sheet>
|
|
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
|
|
<div class="oe_title">
|
|
<label for="name" class="oe_edit_only"/>
|
|
<h1><field name="name" placeholder="e.g. Schedule a meeting"/></h1>
|
|
</div>
|
|
<group>
|
|
<group name="activity_details" string="Activity Settings">
|
|
<field name="active" invisible="1"/>
|
|
<field name="category"/>
|
|
<field name="default_user_id" options="{'no_create': True}" domain="[('share', '=', False)]"/>
|
|
<field name="res_model" groups="base.group_no_one"/>
|
|
<field name="res_model" invisible="1"/>
|
|
<field name="res_model_change" invisible="1"/>
|
|
<field name="initial_res_model" invisible="1"/>
|
|
<field name="summary" placeholder="e.g. "Discuss proposal""/>
|
|
<field name="icon" groups="base.group_no_one"/>
|
|
<field name="decoration_type" groups="base.group_no_one"/>
|
|
<field name="keep_done"/>
|
|
</group>
|
|
<group name="activity_planning" string="Next Activity">
|
|
<field name="chaining_type" invisible="category == 'upload_file'"/>
|
|
<field name="triggered_next_type_id" options="{'no_open': True}" context="{'default_res_model': res_model}"
|
|
invisible="chaining_type == 'suggest' and category != 'upload_file'"
|
|
required="chaining_type == 'trigger' and category != 'upload_file'"/>
|
|
<field name="suggested_next_type_ids" widget="many2many_tags" context="{'default_res_model': res_model}"
|
|
invisible="chaining_type == 'trigger' or category == 'upload_file'"/>
|
|
<field name="mail_template_ids" widget="many2many_tags"
|
|
domain="[('model_id.model', '=', res_model)]"
|
|
invisible="not res_model"
|
|
context="{'default_model': res_model}"/>
|
|
<label for="delay_count"/>
|
|
<div>
|
|
<field class="oe_inline pe-1 o_input_3ch" name="delay_count"/>
|
|
<field class="oe_inline ps-1 pe-2" name="delay_unit"/>
|
|
<field class="oe_inline" name="delay_from"/>
|
|
</div>
|
|
</group>
|
|
</group>
|
|
<label for="default_note" class="fw-bold"/>
|
|
<field nolabel="1" name="default_note" placeholder="e.g. "Go over the offer and discuss details"" class="oe-bordered-editor"/>
|
|
<p class="alert alert-info" role="alert" invisible="not res_model_change">Modifying the model can have an impact on existing activities using this activity type, be careful.</p>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_type_form_inherit" model="ir.ui.view">
|
|
<field name="name">mail.activity.type.form.inherit</field>
|
|
<field name="model">mail.activity.type</field>
|
|
<field name="inherit_id" ref="mail.mail_activity_type_view_form"/>
|
|
<field name="mode">primary</field>
|
|
<field name="priority">50</field>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//label[@for='delay_count']" position="attributes">
|
|
<attribute name="invisible">chaining_type == 'suggest' and not suggested_next_type_ids or chaining_type == 'trigger' and not triggered_next_type_id</attribute>
|
|
</xpath>
|
|
<field name="delay_count" position="attributes">
|
|
<attribute name="invisible">chaining_type == 'suggest' and not suggested_next_type_ids or chaining_type == 'trigger' and not triggered_next_type_id</attribute>
|
|
</field>
|
|
<field name="delay_from" position="attributes">
|
|
<attribute name="invisible">chaining_type == 'suggest' and not suggested_next_type_ids or chaining_type == 'trigger' and not triggered_next_type_id</attribute>
|
|
</field>
|
|
<field name="delay_unit" position="attributes">
|
|
<attribute name="invisible">chaining_type == 'suggest' and not suggested_next_type_ids or chaining_type == 'trigger' and not triggered_next_type_id</attribute>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_type_view_search" model="ir.ui.view">
|
|
<field name="name">mail.activity.type.search</field>
|
|
<field name="model">mail.activity.type</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Activities">
|
|
<field name="name"/>
|
|
<filter string="Archived" domain="[('active', '=', False)]" name="archived"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_type_view_tree" model="ir.ui.view">
|
|
<field name="name">mail.activity.type.view.tree</field>
|
|
<field name="model">mail.activity.type</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Activities" sample="1">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="name"/>
|
|
<field name="summary"/>
|
|
<field name="delay_label" string="Planned in" class="text-end"/>
|
|
<field name="delay_from" string="Type"/>
|
|
<field name="res_model" groups="base.group_no_one"/>
|
|
<field name="icon" groups="base.group_no_one"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_type_action" model="ir.actions.act_window">
|
|
<field name="name">Activity Types</field>
|
|
<field name="res_model">mail.activity.type</field>
|
|
<field name="view_mode">tree,form</field>
|
|
</record>
|
|
|
|
|
|
<record id="mail_activity_action" model="ir.actions.act_window">
|
|
<field name="name">Activities</field>
|
|
<field name="res_model">mail.activity</field>
|
|
<field name="view_mode">tree,form</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_view_form_popup" model="ir.ui.view">
|
|
<field name="name">mail.activity.view.form.popup</field>
|
|
<field name="model">mail.activity</field>
|
|
<field name="priority">20</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Log an Activity" create="false">
|
|
<sheet string="Activity">
|
|
<div class="oe_button_box" name="button_box" invisible="1">
|
|
<button name="action_open_document"
|
|
type="object" class="oe_link" icon="fa-file-text-o"
|
|
invisible="not res_model or res_id == 0">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_text">Open Document</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
<group invisible="1">
|
|
<field name="activity_category" invisible="1" />
|
|
<field name="res_model" invisible="1"/>
|
|
<field name="res_model_id" invisible="1"/>
|
|
<field name="res_id" invisible="1"/>
|
|
<field name="chaining_type" invisible="1"/>
|
|
<field name="previous_activity_type_id"/>
|
|
<field name="has_recommended_activities"/>
|
|
</group>
|
|
<group invisible="not has_recommended_activities">
|
|
<field name="recommended_activity_type_id" widget="selection_badge"
|
|
domain="[('previous_type_ids', '=', previous_activity_type_id)]"
|
|
string="Recommended Activities"/>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="activity_type_id" required="1" options="{'no_create': True, 'no_open': True}"/>
|
|
<field name="summary" placeholder="e.g. Discuss proposal"/>
|
|
</group>
|
|
<group>
|
|
<field name="date_deadline"/>
|
|
<field name="user_id" widget="many2one_avatar_user"/>
|
|
</group>
|
|
</group>
|
|
<field name="note" class="oe-bordered-editor" placeholder="Log a note..."/>
|
|
<footer>
|
|
<field name="id" invisible="1"/>
|
|
<button id="mail_activity_schedule" string="Schedule" close="1" name="action_close_dialog" type="object" class="btn-primary"
|
|
invisible="id" data-hotkey="q"/>
|
|
<button id="mail_activity_save" string="Save" name="action_close_dialog" type="object" class="btn-primary"
|
|
invisible="not id" data-hotkey="q"/>
|
|
<button invisible="chaining_type == 'trigger'" string="Mark as Done" name="action_done"
|
|
type="object" class="btn-secondary" data-hotkey="w"
|
|
context="{'mail_activity_quick_update': True}"/>
|
|
<button invisible="chaining_type == 'trigger'" string="Done & Schedule Next" name="action_done_schedule_next"
|
|
type="object" class="btn-secondary" data-hotkey="q"
|
|
context="{'mail_activity_quick_update': True}"/>
|
|
<button invisible="chaining_type == 'suggest'" string="Done & Launch Next" name="action_done_schedule_next"
|
|
type="object" class="btn-secondary" data-hotkey="q"
|
|
context="{'mail_activity_quick_update': True}"/>
|
|
<button string="Discard" class="btn-secondary" special="cancel" data-hotkey="x" />
|
|
</footer>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_view_form" model="ir.ui.view">
|
|
<field name="name">mail.activity.view.form</field>
|
|
<field name="model">mail.activity</field>
|
|
<field name="priority">21</field>
|
|
<field name="mode">primary</field>
|
|
<field name="inherit_id" ref="mail.mail_activity_view_form_popup"/>
|
|
<field name="arch" type="xml">
|
|
<field name="activity_type_id" position="before">
|
|
<field name="res_name" readonly="1" string="Document"/>
|
|
</field>
|
|
<footer position="replace"/>
|
|
<xpath expr="//div[hasclass('oe_button_box')]" position="attributes">
|
|
<attribute name="invisible">0</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_view_search" model="ir.ui.view">
|
|
<field name="name">mail.activity.view.search</field>
|
|
<field name="model">mail.activity</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Activity">
|
|
<field name="res_model"/>
|
|
<field name="summary"/>
|
|
<field name="activity_type_id"/>
|
|
<filter invisible="1" string="Late Activities" name="activities_overdue"
|
|
domain="[('date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
|
help="Show all records which has next action date is before today"/>
|
|
<filter invisible="1" string="Today Activities" name="activities_today"
|
|
domain="[('date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
|
|
domain="[('date_deadline', '>', context_today().strftime('%Y-%m-%d'))
|
|
]"/>
|
|
<group expand="0" string="Group By">
|
|
<filter string="Deadline" name="date_deadline" context="{'group_by': 'date_deadline'}"/>
|
|
<filter string="Created By" name="createdby" context="{'group_by': 'create_uid'}"/>
|
|
<filter string="Activity Type" name="activittype" context="{'group_by': 'activity_type_id'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_view_tree" model="ir.ui.view">
|
|
<field name="name">mail.activity.view.tree</field>
|
|
<field name="model">mail.activity</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Next Activities"
|
|
decoration-danger="date_deadline < current_date"
|
|
decoration-success="date_deadline == current_date"
|
|
default_order="date_deadline" create="false">
|
|
<field name="res_name"/>
|
|
<field name="activity_type_id"/>
|
|
<field name="summary"/>
|
|
<field name="date_deadline"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="mail_activity_action_view_tree" model="ir.actions.act_window.view">
|
|
<field name="sequence" eval="1"/>
|
|
<field name="view_mode">tree</field>
|
|
<field name="act_window_id" ref="mail.mail_activity_action"/>
|
|
</record>
|
|
<record id="mail_activity_action_view_form" model="ir.actions.act_window.view">
|
|
<field name="sequence" eval="2"/>
|
|
<field name="view_mode">form</field>
|
|
<field name="view_id" ref="mail.mail_activity_view_form"/>
|
|
<field name="act_window_id" ref="mail.mail_activity_action"/>
|
|
</record>
|
|
|
|
<record id="mail_activity_view_calendar" model="ir.ui.view">
|
|
<field name="name">mail.activity.view.calendar</field>
|
|
<field name="model">mail.activity</field>
|
|
<field name="priority" eval="2"/>
|
|
<field name="arch" type="xml">
|
|
<calendar string="Activity" date_start="date_deadline" color="activity_type_id">
|
|
<field name="user_id" avatar_field="avatar_128"/>
|
|
<field name="res_name"/>
|
|
<field name="date_deadline"/>
|
|
<field name="summary"/>
|
|
<field name="activity_type_id" filters="1" invisible="1"/>
|
|
</calendar>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|