[IMP] project: Clean timesheet related fields on task form
-Moved the share Button to the dropdown Action menu as it was better suitable there. -moved sale order item field to extra info as it was better suitable there. -changed display of settings for project to give it organized look. Related Task ID: 1928422 closes odoo/odoo#30310
This commit is contained in:
committed by
Yannick Tivisse
parent
514d6fb90d
commit
b8f7df1a6a
@@ -2,7 +2,7 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from lxml import etree
|
||||
import json
|
||||
import re
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
@@ -92,7 +92,7 @@ class AccountAnalyticLine(models.Model):
|
||||
# custom inheretied view stored in database. Even if normally, no xpath can be done on
|
||||
# 'string' attribute.
|
||||
for node in doc.xpath("//field[@name='unit_amount'][@widget='timesheet_uom'][not(@string)]"):
|
||||
node.set('string', _('Duration (%s)') % (encoding_uom.name))
|
||||
node.set('string', _('Duration (%s)') % (re.sub(r'[\(\)]', '', encoding_uom.name or '')))
|
||||
return etree.tostring(doc, encoding='unicode')
|
||||
|
||||
# ----------------------------------------------------
|
||||
|
||||
@@ -415,7 +415,6 @@
|
||||
<header>
|
||||
<button name="action_assign_to_me" string="Assign to Me" type="object" class="oe_highlight"
|
||||
attrs="{'invisible' : [('user_id', '!=', False)]}"/>
|
||||
<button name="%(portal.portal_share_action)d" string="Share" type="action" class="oe_highlight oe_read_only"/>
|
||||
<field name="stage_id" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}"/>
|
||||
</header>
|
||||
<sheet string="Task">
|
||||
@@ -500,6 +499,16 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="portal_share_action"
|
||||
name="Share"
|
||||
res_model="portal.share"
|
||||
src_model="project.task"
|
||||
view_type="form"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
/>
|
||||
|
||||
<record id="quick_create_task_form" model="ir.ui.view">
|
||||
<field name="name">project.task.form.quick_create</field>
|
||||
<field name="model">project.task</field>
|
||||
|
||||
@@ -48,17 +48,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_hr_timesheet"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_hr_timesheet"/>
|
||||
<div class="text-muted">
|
||||
Log time on tasks
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Time Management</h2>
|
||||
<div class="row mt16 o_settings_container" name="project_time">
|
||||
@@ -73,6 +62,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_hr_timesheet"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_hr_timesheet"/>
|
||||
<div class="text-muted">
|
||||
Log time on tasks
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
string="Sales Order"/>
|
||||
<field name="sale_order_id" invisible="1"/>
|
||||
</xpath>
|
||||
<field name="user_id" position="after">
|
||||
<field name="partner_id" position="after">
|
||||
<field name="sale_line_id" string="Sales Order Item" attrs="{'invisible': ['|', ('partner_id', '=', False)]}" options='{"no_create": True}' context="{'create': False, 'edit': False, 'delete': False}"/>
|
||||
<field name="billable_type" invisible="1"/>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user