[IMP] project : Add project Tree view, improve some wordings and hide uom conversion when default and selected are the same
Before this commit, In the product form, when the selected uom is Hours and as Hours is the default uom, we display this conversion (1.0 Hours = 1.0 Hours) which is useless Before this commit, Kanban is the only view available for projects. With this view, we can't select a batch of projects and display optional fields Before this commit, Some wordings didn't have a significant meaning. This commit hides uom conversion when selected and default uom are the same. This commit adds the projects tree view. This commit improves some wordings according to what was mentionned in the task. task-2724965 closes odoo/odoo#82135 Related: odoo/enterprise#23206 Related: odoo/upgrade#3207 Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
@@ -34,14 +34,9 @@ def create_internal_project(cr, registry):
|
||||
|
||||
def _uninstall_hook(cr, registry):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
xml_ids = [
|
||||
'project.open_view_project_all',
|
||||
'project.open_view_project_all_group_stage'
|
||||
]
|
||||
for xml_id in xml_ids:
|
||||
act_window = env.ref(xml_id, raise_if_not_found=False)
|
||||
if act_window and act_window.domain and 'is_internal_project' in act_window.domain:
|
||||
act_window.domain = []
|
||||
act_window = env.ref('project.open_view_project_all', raise_if_not_found=False)
|
||||
if act_window and act_window.domain and 'is_internal_project' in act_window.domain:
|
||||
act_window.domain = []
|
||||
|
||||
# archive the internal projects
|
||||
project_ids = env['res.company'].search([('internal_project_id', '!=', False)]).mapped('internal_project_id')
|
||||
|
||||
@@ -404,9 +404,5 @@
|
||||
<field name="domain">[('is_internal_project', '=', False)]</field>
|
||||
</record>
|
||||
|
||||
<record id="project.open_view_project_all_group_stage" model="ir.actions.act_window">
|
||||
<field name="domain">[('is_internal_project', '=', False)]</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -14,4 +14,3 @@ from . import project_update
|
||||
from . import res_config_settings
|
||||
from . import res_partner
|
||||
from . import digest
|
||||
from . import ir_ui_menu
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class IrUiMenu(models.Model):
|
||||
_inherit = 'ir.ui.menu'
|
||||
|
||||
def _load_menus_blacklist(self):
|
||||
res = super()._load_menus_blacklist()
|
||||
if self.env.user.has_group('project.group_project_stages'):
|
||||
res.append(self.env.ref('project.menu_projects').id)
|
||||
return res
|
||||
@@ -696,13 +696,6 @@ class Project(models.Model):
|
||||
action_context['search_default_project_id'] = self.id
|
||||
return dict(action, context=action_context)
|
||||
|
||||
@api.model
|
||||
def _action_open_all_projects(self):
|
||||
action = self.env['ir.actions.act_window']._for_xml_id(
|
||||
'project.open_view_project_all' if not self.user_has_groups('project.group_project_stages') else
|
||||
'project.open_view_project_all_group_stage')
|
||||
return action
|
||||
|
||||
def action_view_analytic_account_entries(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<p class="o_view_nocontent_empty_folder">
|
||||
No data yet!
|
||||
</p><p>
|
||||
Analyze the performance of your tasks and your workers.
|
||||
Analyze the progress of your projects and the performance of your employees.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<p class="o_view_nocontent_empty_folder">
|
||||
No data yet!
|
||||
</p>
|
||||
<p>Analyze how quickly your team is completing your project's tasks and check if everything is going according to plan.</p>
|
||||
<p>Analyze how quickly your team is completing your project's tasks and check if everything is progressing according to plan.</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ tour.register('project_tour', {
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".o_ChatterTopbar_buttonScheduleActivity",
|
||||
content: Markup(_t("Use <b>activities</b> to organize your daily work.")),
|
||||
content: Markup(_t("Create <b>activities</b> to set yourself to-dos or to schedule meetings.")),
|
||||
}, {
|
||||
trigger: ".modal-dialog .btn-primary",
|
||||
content: "Schedule your activity once it is ready.",
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No stages found. Let's create one!
|
||||
</p><p>
|
||||
Track the progress of your projects from their creation to their closing.
|
||||
Define the steps your projects move through from creation to completion.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group>
|
||||
<field name="name" string="Task Title" placeholder="e.g. New Design"/>
|
||||
<field name="name" string="Task Title" placeholder="e.g. Send Invitations"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -290,9 +290,10 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No tasks found. Let's create one!
|
||||
</p><p>
|
||||
To get things done, use activities and status on tasks.<br/>
|
||||
Chat in real time or by email to collaborate efficiently.
|
||||
</p>
|
||||
<p>
|
||||
Keep track of the progress of your tasks from creation to completion.<br/>
|
||||
Collaborate efficiently by chatting in real-time or via email.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -94,9 +94,10 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No tasks found. Let's create one!
|
||||
</p><p>
|
||||
To get things done, use activities and status on tasks.<br/>
|
||||
Chat in real-time or by email to collaborate efficiently.
|
||||
</p>
|
||||
<p>
|
||||
Keep track of the progress of your tasks from creation to completion.<br/>
|
||||
Collaborate efficiently by chatting in real-time or via email.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -111,9 +112,10 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No tasks found. Let's create one!
|
||||
</p><p>
|
||||
To get things done, use activities and status on tasks.<br/>
|
||||
Chat in real time or by email to collaborate efficiently.
|
||||
</p>
|
||||
<p>
|
||||
Keep track of the progress of your tasks from creation to completion.<br/>
|
||||
Collaborate efficiently by chatting in real-time or via email.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -254,7 +256,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No stages found. Let's create one!
|
||||
</p><p>
|
||||
Track the progress of your tasks from their creation to their closing.
|
||||
Define the steps your tasks move through from creation to completion.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -761,38 +763,32 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Please update both act_window when modifying one (open_view_project_all or open_view_project_all_group_stage) as one or the other is used in the menu menu_project_config -->
|
||||
<record id="view_project_kanban_inherit" model="ir.ui.view">
|
||||
<field name="name">project.kanban.inherit.project</field>
|
||||
<field name="model">project.project</field>
|
||||
<field name="groups_id" eval="[Command.link(ref('project.group_project_stages'))]"/>
|
||||
<field name="inherit_id" ref="view_project_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//kanban" position="attributes">
|
||||
<attribute name="default_group_by">stage_id</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_view_project_all" model="ir.actions.act_window">
|
||||
<field name="name">Projects</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="view_project_kanban"/>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_id" ref="view_project_kanban_inherit"/>
|
||||
<field name="search_view_id" ref="view_project_project_filter"/>
|
||||
<field name="target">main</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No projects found. Let's create one!
|
||||
</p><p>
|
||||
Projects regroup tasks on the same topic, and each has its dashboard.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_view_project_all_group_stage" model="ir.actions.act_window">
|
||||
<field name="name">Projects</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="view_project_kanban"/>
|
||||
<field name="search_view_id" ref="view_project_project_filter"/>
|
||||
<field name="target">main</field>
|
||||
<field name="context">{'search_default_groupby_stage': 1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No projects found. Let's create one!
|
||||
</p><p>
|
||||
Projects regroup tasks on the same topic, and each has its dashboard.
|
||||
<p>
|
||||
Projects contain tasks on the same topic, and each has its own dashboard.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -810,8 +806,9 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No projects found. Let's create one!
|
||||
</p><p>
|
||||
Projects regroup tasks on the same topic, and each has its dashboard.
|
||||
</p>
|
||||
<p>
|
||||
Projects contain tasks on the same topic, and each has its own dashboard.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1073,7 +1070,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group>
|
||||
<field name="name" string = "Task Title" placeholder="e.g. New Design"/>
|
||||
<field name="name" string = "Task Title" placeholder="e.g. Send Invitations"/>
|
||||
<field name="user_ids" options="{'no_open': True,'no_create': True}" domain="[('share', '=', False), ('active', '=', True)]"
|
||||
widget="many2many_tags"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
@@ -1323,9 +1320,10 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No tasks found. Let's create one!
|
||||
</p><p>
|
||||
To get things done, use activities and status on tasks.<br/>
|
||||
Chat in real-time or by email to collaborate efficiently.
|
||||
</p>
|
||||
<p>
|
||||
Keep track of the progress of your tasks from creation to completion.<br/>
|
||||
Collaborate efficiently by chatting in real-time or via email.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1339,9 +1337,10 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No tasks found. Let's create one!
|
||||
</p><p>
|
||||
To get things done, use activities and status on tasks.<br/>
|
||||
Chat in real-time or by email to collaborate efficiently.
|
||||
</p>
|
||||
<p>
|
||||
Organize your tasks by dispatching them across the pipeline.<br/>
|
||||
Collaborate efficiently by chatting in real-time or via email.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1393,7 +1392,6 @@
|
||||
<menuitem action="open_task_type_form" id="menu_project_config_project" name="Task Stages" parent="menu_project_config" sequence="10" groups="base.group_no_one"/>
|
||||
|
||||
<menuitem action="open_view_project_all" id="menu_projects" name="Projects" parent="menu_main_pm" sequence="1"/>
|
||||
<menuitem action="open_view_project_all_group_stage" id="menu_projects_group_stage" name="Projects" parent="menu_main_pm" sequence="1" groups="project.group_project_stages"/>
|
||||
<menuitem action="open_view_project_all_config" id="menu_projects_config" name="Projects" parent="menu_project_config" sequence="5"/>
|
||||
|
||||
<!-- User Form -->
|
||||
|
||||
@@ -204,7 +204,8 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_empty_folder">
|
||||
No customer ratings yet
|
||||
</p><p>
|
||||
</p>
|
||||
<p>
|
||||
Let's wait for your customers to manifest themselves.
|
||||
</p>
|
||||
</field>
|
||||
@@ -254,8 +255,9 @@
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_empty_folder">
|
||||
No customer ratings yet
|
||||
</p><p>
|
||||
Let's wait for your customers to manifest themselves.
|
||||
</p>
|
||||
<p>
|
||||
Measure your customer satisfaction by sending rating requests when your tasks reach a certain stage.
|
||||
</p>
|
||||
</field>
|
||||
<field name="context">{
|
||||
|
||||
@@ -25,4 +25,4 @@ class ProjectDelete(models.TransientModel):
|
||||
|
||||
def confirm_delete(self):
|
||||
self.with_context(active_test=False).project_ids.unlink()
|
||||
return self.env["project.project"]._action_open_all_projects()
|
||||
return self.env['ir.actions.act_window']._for_xml_id('project.open_view_project_all')
|
||||
|
||||
@@ -29,10 +29,11 @@ class ProductTemplate(models.Model):
|
||||
def _compute_service_upsell_threshold_ratio(self):
|
||||
product_uom_hour = self.env.ref('uom.product_uom_hour')
|
||||
for record in self:
|
||||
if not record.uom_id:
|
||||
if not record.uom_id or product_uom_hour.factor == record.uom_id.factor:
|
||||
record.service_upsell_threshold_ratio = False
|
||||
continue
|
||||
record.service_upsell_threshold_ratio = f"1 {record.uom_id.name} = {product_uom_hour.factor / record.uom_id.factor:.2f} Hours"
|
||||
if product_uom_hour.factor != record.uom_id.factor:
|
||||
record.service_upsell_threshold_ratio = f"(1 {record.uom_id.name} = {product_uom_hour.factor / record.uom_id.factor:.2f} Hours)"
|
||||
|
||||
def _compute_visible_expense_policy(self):
|
||||
visibility = self.user_has_groups('project.group_project_user')
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div attrs="{'invisible': ['|', ('type', '!=', 'service'), ('service_policy', '!=', 'ordered_prepaid')]}" class="font-italic text-muted">
|
||||
Warn the salesperson for an upsell when work done exceeds
|
||||
<field name="service_upsell_threshold" widget="percentage" class="oe_inline"/>
|
||||
of hours sold. (<field name="service_upsell_threshold_ratio" class="oe_inline"/>)
|
||||
of hours sold. <field name="service_upsell_threshold_ratio" class="oe_inline" attrs="{'invisible': [('service_upsell_threshold_ratio', '=', False)]}"/>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user