[IMP] project,sale,hr(_timesheet): Generic improments for project
Done the below several improvement on project: - move the stage description and tooltips to the debug mode - remove the 'need assistance' tag - Change the app description in manifest file 'Organize and plan your projects.' - Change the burger menu sequence into: Edit/Delete/Share/Set Cover Image - change the description of the pad feature into, 'edit tasks description collaboratively in real time. see each author's text in a distinct color.' - add the following tooltip for the allow_billable field, 'invoice your time and material from tasks.' - add an fa-stopwatch icon in front of the Start & the Stop buttons in task's form view - rename the 'validate time spent' modal into 'confirm time spent ' + increase the size of the description field + this field should not be required - project overview: rename 'Hours recorded' into' Recorded Hours' - project form view: disable the creation for the portal users field - Rename the 'ready for next stage' kanban state into 'Ready' TaskID: 2232051 Related Enterprise PR: https://github.com/odoo/enterprise/pull/9961 closes odoo/odoo#49694 Closes: #49694 Related: odoo/enterprise#9961 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Yannick Tivisse
parent
fdc20d13bb
commit
63cbe8678a
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo import api, fields, models
|
||||
from datetime import datetime
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ProjectTaskCreateTimesheet(models.TransientModel):
|
||||
@@ -18,9 +17,7 @@ class ProjectTaskCreateTimesheet(models.TransientModel):
|
||||
|
||||
active_id = self._context.get('active_id')
|
||||
if 'task_id' in fields and active_id:
|
||||
task_id = self.env['project.task'].browse(active_id)
|
||||
result['task_id'] = active_id
|
||||
result['description'] = task_id.name
|
||||
return result
|
||||
|
||||
time_spent = fields.Float('Time', digits=(16, 2))
|
||||
|
||||
@@ -7,15 +7,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Save time">
|
||||
<group>
|
||||
<group>
|
||||
<field name="task_id" invisible="True"/>
|
||||
<label for="time_spent"/>
|
||||
<div class="o_row" >
|
||||
<field name="time_spent" widget="float_time" required="True"/>
|
||||
hours
|
||||
</div>
|
||||
<field name="description" widget="text" required="True"/>
|
||||
</group>
|
||||
<field name="task_id" invisible="True"/>
|
||||
<field name="time_spent" string="Duration" class="oe_inline" widget="float_time" required="True"/>
|
||||
<field name="description" widget="text" placeholder="Describe your activity..."/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Save" type="object" name="save_timesheet" class="btn btn-primary"/>
|
||||
|
||||
@@ -49,7 +49,7 @@ class ProjectProject(models.Model):
|
||||
|
||||
pad_availability = fields.Selection([
|
||||
('internal', 'Internal Users'),
|
||||
('portal', 'Portal Users')
|
||||
('portal', 'Internal Users & Portal Users')
|
||||
], compute='_compute_pad_availability', store=True, readonly=False,
|
||||
string='Availability of collaborative pads', required=True, default='internal')
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="use_pads" string="Collaborative Pads"/>
|
||||
<div class="text-muted">
|
||||
Use collaborative rich text pads on tasks
|
||||
Edit tasks' description collaboratively in real time.<br/>
|
||||
See each author's text in a distinct color.
|
||||
</div>
|
||||
<div class="content-group" attrs="{'invisible': ['|', ('use_pads', '=', False), ('privacy_visibility', '!=', 'portal')]}">
|
||||
<div class="mt16 row">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
'website': 'https://www.odoo.com/page/project-management',
|
||||
'category': 'Services/Project',
|
||||
'sequence': 10,
|
||||
'summary': 'Organize and schedule your projects ',
|
||||
'summary': 'Organize and plan your projects',
|
||||
'depends': [
|
||||
'analytic',
|
||||
'base_setup',
|
||||
|
||||
@@ -29,7 +29,7 @@ class ProjectTaskType(models.Model):
|
||||
'Red Kanban Label', default=lambda s: _('Blocked'), translate=True, required=True,
|
||||
help='Override the default value displayed for the blocked state for kanban selection, when the task or issue is in that stage.')
|
||||
legend_done = fields.Char(
|
||||
'Green Kanban Label', default=lambda s: _('Ready for Next Stage'), translate=True, required=True,
|
||||
'Green Kanban Label', default=lambda s: _('Ready'), translate=True, required=True,
|
||||
help='Override the default value displayed for the done state for kanban selection, when the task or issue is in that stage.')
|
||||
legend_normal = fields.Char(
|
||||
'Grey Kanban Label', default=lambda s: _('In Progress'), translate=True, required=True,
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
<field name="analytic_account_id" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" context="{'default_partner_id': partner_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="privacy_visibility" widget="radio"/>
|
||||
<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="allowed_portal_user_ids" widget="many2many_tags" options="{'no_create': True}" attrs="{'invisible': [('privacy_visibility', '!=', 'portal')]}"/>
|
||||
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
@@ -788,7 +788,11 @@
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<a t-if="widget.editable" role="menuitem" type="set_cover" data-auto-open="1" class="dropdown-item" data-field="displayed_image_id">Set Cover Image</a>
|
||||
<a name="%(portal.portal_share_action)d" role="menuitem" type="action" class="dropdown-item">Share</a>
|
||||
<a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit Task</a>
|
||||
<a t-if="widget.editable" role="menuitem" type="edit" class="dropdown-item">Edit</a>
|
||||
<a t-if="widget.editable" role="menuitem" class="dropdown-item" name="toggle_active" type="object">
|
||||
<t t-if="record.active.raw_value">Archive</t>
|
||||
<t t-if="!record.active.raw_value">Restore</t>
|
||||
</a>
|
||||
<a t-if="widget.deletable" role="menuitem" type="delete" class="dropdown-item">Delete</a>
|
||||
<div role="separator" class="dropdown-divider"></div>
|
||||
<ul class="oe_kanban_colorpicker" data-field="color"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="o_setting_right_pane" name="pad_project_right_pane">
|
||||
<label for="module_pad"/>
|
||||
<div class="text-muted">
|
||||
Use collaborative rich text pads on tasks
|
||||
Edit tasks' description collaboratively in real time. See each author's text in a distinct color.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@ class Project(models.Model):
|
||||
sale_line_employee_ids = fields.One2many('project.sale.line.employee.map', 'project_id', "Sale line/Employee map", copy=False,
|
||||
help="Employee/Sale Order Item Mapping:\n Defines to which sales order item an employee's timesheet entry will be linked."
|
||||
"By extension, it defines the rate at which an employee's time on the project is billed.")
|
||||
allow_billable = fields.Boolean("Bill from Tasks")
|
||||
allow_billable = fields.Boolean("Bill from Tasks", help="Invoice your time and material from tasks.")
|
||||
display_create_order = fields.Boolean(compute='_compute_display_create_order')
|
||||
timesheet_product_id = fields.Many2one(
|
||||
'product.product', string='Timesheet Product',
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
</t>
|
||||
<t t-if="isinstance(stat_button['name'], list)">
|
||||
<div class="oe_inline">
|
||||
<span class="o_stat_value mr-1" t-if="'count' in stat_button">
|
||||
<t t-esc="stat_button['count']"/>
|
||||
<span class="o_stat_value mr-1">
|
||||
<t t-esc="stat_button.get('count')"/>
|
||||
</span>
|
||||
<span class="o_stat_value">
|
||||
<t t-esc="stat_button['name'][0]"/>
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
|
||||
<div class="o_title">
|
||||
<h2>Hours recorded and Profitability</h2>
|
||||
<h2>Recorded Hours and Profitability</h2>
|
||||
</div>
|
||||
|
||||
<t t-set="display_cost" t-value="dashboard['profit']['expense_cost'] != 0.0"/>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="text-muted" id="allow_billable_setting">
|
||||
Invoice your time and material from tasks
|
||||
</div>
|
||||
<field name="timesheet_product_id" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('allow_timesheets', '=', False)], 'required': ['&', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}"/>
|
||||
<field name="timesheet_product_id" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('allow_timesheets', '=', False)], 'required': ['&', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}" context="{'default_type': 'service'}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user