diff options
| author | Kevin Baptiste <kba@odoo.com> | 2019-11-28 10:52:44 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-01-31 15:35:54 +0000 |
| commit | 2ac06038dd08be863c27cc7d1d7aec9a70ec2105 (patch) | |
| tree | 443ed8ae03a06f554cee594ada23a019c423a050 /addons/project/views/project_views.xml | |
| parent | b5902c3fa23c444565eaf0b1aa6d8f956ce14453 (diff) | |
[IMP] project, industry_fsm: Improve subtasks and configuration UX
Purpose
=======
In Project, the configuration has to be done twice: in the settings of the
app and on each project.
During the onboarding, the user won't understand that a feature has to be
enabled at both places and will think that the system just doesn't work.
If the user enabled a feature, he most likely intends on using it for most
of his projects. Therefore, having to do a double configuration for each
new project is annoying.
By the way, sub-tasks is the only global feature (it can't be enabled or
disabled by project), so we are breaking it down by project to remain
consistent with the rest.
Specification
=============
1/ Enable subtasks per project
Before this commit, sub-tasks were a global feature (i.e. once enabled
they were enabled for all projects). This commit gives the ability to
enable/disable sub-tasks per project.
2/ Make project_id on planning required
3/ Change default rating status on new projects
4/ Default value for allow_subtasks
5/ Enable timesheets on existing projects
6/ Hide Total Hours if subtasks are disabled
7/ Create project in the company context.
Otherwise some records generation could use a default company which is not
the company for which we want to create a project.
8/ Default value for allow_forecast, is_fsm
9/ Change reference to timesheet product
10/ Fix tracback on industry_fsm_report.
Before this commit, there was a traceback when enabling "Worksheets"
(industry_fsm_report) after "Time and Material" (industry_fsm_sale).
11/ Convert some onchange method into computed editable stored fields
closes odoo/odoo#41218
Taskid: 2146474
Related: odoo/enterprise#6998
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Diffstat (limited to 'addons/project/views/project_views.xml')
| -rw-r--r-- | addons/project/views/project_views.xml | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 9346f0de6e4..77e59bd9d45 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -79,6 +79,14 @@ <field name="res_model">project.task</field> <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field> <field name="search_view_id" ref="project.view_task_search_form"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Click <i>Create</i> to start a new task. + </p><p> + To get things done, use activities and status on tasks.<br/> + Chat in real time or by email to collaborate efficiently. + </p> + </field> </record> <!-- Project --> @@ -136,7 +144,6 @@ <field name="allowed_internal_user_ids" widget="many2many_tags" attrs="{'invisible': [('privacy_visibility', '!=', 'followers')]}"/> <field name="allowed_portal_user_ids" widget="many2many_tags" attrs="{'invisible': [('privacy_visibility', '!=', 'portal')]}"/> - <field name="subtask_project_id" groups="project.group_subtask_project"/> <field name="company_id" groups="base.group_multi_company"/> </group> <group name="extra_settings"> @@ -165,6 +172,21 @@ </div> </div> </div> + <div class="col-lg-6 o_setting_box" id="subtask_settings" groups="project.group_subtask_project"> + <div class="o_setting_left_pane"> + <field name="allow_subtasks" /> + </div> + <div class="o_setting_right_pane"> + <label for="allow_subtasks" /> + <div class="text-muted"> + Split your tasks to organize your work into sub-milestones + </div> + <div class="mt8" attrs="{'invisible': [('allow_subtasks', '=', False)]}"> + <label for="subtask_project_id" /> + <field name="subtask_project_id" /> + </div> + </div> + </div> </div> <group name="misc"> <group string="Time Scheduling"> @@ -448,6 +470,7 @@ <field eval="2" name="priority"/> <field name="arch" type="xml"> <form string="Task" class="o_form_project_tasks"> + <field name="allow_subtasks" invisible="1" /> <header> <button name="action_assign_to_me" string="Assign to Me" type="object" class="oe_highlight" attrs="{'invisible' : [('user_id', '!=', False)]}"/> @@ -456,7 +479,7 @@ <sheet string="Task"> <div class="oe_button_box" name="button_box"> <button name="action_subtask" type="object" class="oe_stat_button" icon="fa-tasks" - attrs="{'invisible' : [('id', '=', False)]}" context="{'default_user_id': user_id, 'default_parent_id': id, 'default_project_id': subtask_project_id}" groups="project.group_subtask_project"> + attrs="{'invisible' : ['|', ('allow_subtasks', '=', False), ('id', '=', False)]}" context="{'default_user_id': user_id, 'default_parent_id': id, 'default_project_id': subtask_project_id}"> <field string="Sub-tasks" name="subtask_count" widget="statinfo"/> </button> <button name="%(rating_rating_action_task)d" type="action" attrs="{'invisible': [('rating_count', '=', 0)]}" class="oe_stat_button" icon="fa-smile-o" groups="project.group_project_rating"> @@ -482,14 +505,14 @@ <field name="legend_done" invisible="1"/> </group> <group> - <field name="project_id" domain="[('active', '=', True), ('company_id', '=', company_id)]"/> + <field name="project_id" required="1" domain="[('active', '=', True), ('company_id', '=', company_id)]"/> <field name="user_id" class="o_task_user_field" options='{"no_open": True}'/> <field name="parent_id" domain="[('parent_id', '=', False)]" - groups="project.group_subtask_project" + attrs="{'invisible' : [('allow_subtasks', '=', False)]}" /> </group> <!-- YTI FIXME: Clean these fake groups --> @@ -561,7 +584,7 @@ <group> <field name="name" string = "Task Title"/> <field name="user_id" options="{'no_open': True,'no_create': True}"/> - <field name="project_id" invisible="context.get('all_task', 1)"/> + <field name="project_id" required="1" invisible="context.get('all_task', 1)"/> <field name="company_id" invisible="1"/> <field name="parent_id" invisible="1"/> </group> @@ -602,7 +625,7 @@ <div class="o_kanban_record_top"> <div class="o_kanban_record_headings"> <strong class="o_kanban_record_title"><field name="name"/></strong> - <span invisible="context.get('default_project_id', False) or context.get('fsm_mode', False)"><br/><field name="project_id"/></span> + <span invisible="context.get('default_project_id', False) or context.get('fsm_mode', False)"><br/><field name="project_id" required="1"/></span> <br /> <t t-if="record.partner_id.value"> <span t-if="!record.partner_is_company.raw_value"> |
