[IMP] project, project_issue : fix the escalation, usability improvements on views, tooltips and error messages (onboarding).

This commit is contained in:
ppa-odoo
2015-01-02 17:14:47 +01:00
committed by Jérome Maes
parent 099ff0b236
commit 660b13bb78
8 changed files with 24 additions and 23 deletions
+1 -1
View File
@@ -912,7 +912,7 @@ class task(osv.osv):
_constraints = [ _constraints = [
(_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']), (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids']),
(_check_dates, 'Error ! Task end-date must be greater then task start-date', ['date_start','date_end']) (_check_dates, 'Error ! Task starting date must be lower then its ending date.', ['date_start','date_end'])
] ]
# Override view according to the company definition # Override view according to the company definition
+1 -1
View File
@@ -476,7 +476,7 @@
<group> <group>
<group string="Gantt View"> <group string="Gantt View">
<p class="oe_grey" colspan='2'> <p class="oe_grey" colspan='2'>
Assign dates to make this task appear in the gantt chart (<span class="oe_form_gantt_avatars"></span> icon on the top right) Assign dates to make this task appear in the gantt chart ( <i class="fa fa-tasks"> </i> icon on the top right)
</p> </p>
<field name="date_start"/> <field name="date_start"/>
<field name="date_end"/> <field name="date_end"/>
@@ -34,7 +34,7 @@ class project_task_delegate(osv.osv_memory):
'prefix': fields.char('Your Task Title', help="Title for your validation task"), 'prefix': fields.char('Your Task Title', help="Title for your validation task"),
'project_id': fields.many2one('project.project', 'Project', help="User you want to delegate this task to"), 'project_id': fields.many2one('project.project', 'Project', help="User you want to delegate this task to"),
'user_id': fields.many2one('res.users', 'Assign To', required=True, help="User you want to delegate this task to"), 'user_id': fields.many2one('res.users', 'Assign To', required=True, help="User you want to delegate this task to"),
'new_task_description': fields.text('New Task Description', help="Reinclude the description of the task in the task of the user"), 'new_task_description': fields.html('New Task Description', help="Reinclude the description of the task in the task of the user"),
'planned_hours': fields.float('Planned Hours', help="Estimated time to close this task by the delegated user"), 'planned_hours': fields.float('Planned Hours', help="Estimated time to close this task by the delegated user"),
'planned_hours_me': fields.float('Hours to Validate', help="Estimated time for you to validate the work done by the user to whom you delegate this task"), 'planned_hours_me': fields.float('Hours to Validate', help="Estimated time for you to validate the work done by the user to whom you delegate this task"),
'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', help="New state of your own task. Pending will be reopened automatically when the delegated task is closed") 'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', help="New state of your own task. Pending will be reopened automatically when the delegated task is closed")
+4 -2
View File
@@ -196,7 +196,8 @@ class project_issue(osv.Model):
def _can_escalate(self, cr, uid, ids, field_name, arg, context=None): def _can_escalate(self, cr, uid, ids, field_name, arg, context=None):
res = {} res = {}
for issue in self.browse(cr, uid, ids, context=context): for issue in self.browse(cr, uid, ids, context=context):
if issue.project_id.parent_id.type == 'contract': esc_proj = issue.project_id.project_escalation_id
if esc_proj and esc_proj.analytic_account_id.type == 'contract':
res[issue.id] = True res[issue.id] = True
return res return res
@@ -260,7 +261,8 @@ class project_issue(osv.Model):
domain="[('project_ids', '=', project_id)]", copy=False), domain="[('project_ids', '=', project_id)]", copy=False),
'project_id': fields.many2one('project.project', 'Project', track_visibility='onchange', select=True), 'project_id': fields.many2one('project.project', 'Project', track_visibility='onchange', select=True),
'duration': fields.float('Duration'), 'duration': fields.float('Duration'),
'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]",
help="You can link this issue to an existing task or directly create a new one from here"),
'day_open': fields.function(_compute_day, string='Days to Assign', 'day_open': fields.function(_compute_day, string='Days to Assign',
multi='compute_day', type="float", multi='compute_day', type="float",
store={'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['date_open'], 10)}), store={'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['date_open'], 10)}),
+4 -4
View File
@@ -80,7 +80,6 @@
</div> </div>
</group> </group>
<group> <group>
<field name="id"/>
<field name="version_id" groups="base.group_user"/> <field name="version_id" groups="base.group_user"/>
<field name="priority" groups="base.group_user" widget="priority"/> <field name="priority" groups="base.group_user" widget="priority"/>
<label for="task_id" groups="base.group_user"/> <label for="task_id" groups="base.group_user"/>
@@ -94,9 +93,10 @@
<page string="Description"> <page string="Description">
<field name="description" placeholder="Add an internal note..." groups="base.group_user"/> <field name="description" placeholder="Add an internal note..." groups="base.group_user"/>
</page> </page>
<page string="Extra Info" groups="project.group_project_manager,project.group_project_user"> <page string="Extra Info" name="extra_info" groups="project.group_project_manager,project.group_project_user">
<group> <group>
<group string="Statistics"> <group>
<field name="id"/>
<field name="day_open"/> <field name="day_open"/>
<field name="day_close"/> <field name="day_close"/>
<field name="working_hours_open" widget="float_time"/> <field name="working_hours_open" widget="float_time"/>
@@ -104,7 +104,7 @@
<field name="inactivity_days"/> <field name="inactivity_days"/>
<field name="days_since_creation"/> <field name="days_since_creation"/>
</group> </group>
<group string="Status" groups="base.group_no_one"> <group groups="base.group_no_one">
<field name="active"/> <field name="active"/>
</group> </group>
</group> </group>
@@ -10,20 +10,17 @@
<attribute name="on_change">on_change_project(project_id)</attribute> <attribute name="on_change">on_change_project(project_id)</attribute>
</field> </field>
<field name="active" position="after"> <field name="active" position="after">
<newline/> <field name="analytic_account_id"
<group colspan="4"> domain="[('parent_id','!=',False),('partner_id', '=', partner_id),('type', '!=', 'view')]"
<field name="analytic_account_id" on_change='on_change_account_id(analytic_account_id)'/>
domain="[('parent_id','!=',False),('partner_id', '=', partner_id),('type', '!=', 'view')]"
on_change='on_change_account_id(analytic_account_id)'/>
</group>
</field> </field>
<xpath expr="//notebook/page[@string='Extra Info']" position="before"> <xpath expr="//notebook/page[@name='extra_info']" position="before">
<page string="Worklogs"> <page string="Worklogs">
<field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : uid, 'default_account_id' : analytic_account_id}" <field name="timesheet_ids" colspan="4" nolabel="1" context="{'default_user_id' : uid, 'default_account_id' : analytic_account_id}"
groups="base.group_user"> groups="base.group_user">
<tree editable="top" string="Timesheets"> <tree editable="top" string="Timesheets">
<field name="name"/> <field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/> <field name="unit_amount" string="Duration" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
<field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)" groups="analytic.group_analytic_accounting"/> <field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)" groups="analytic.group_analytic_accounting"/>
<field name="date"/> <field name="date"/>
<field name="user_id"/> <field name="user_id"/>
+3 -4
View File
@@ -21,7 +21,7 @@
{ {
'name': 'Create Tasks on SO', 'name': 'Create Tasks from SO',
'version': '1.0', 'version': '1.0',
'category': 'Project Management', 'category': 'Project Management',
'description': """ 'description': """
@@ -33,10 +33,9 @@ This module will automatically create a new task for each procurement order line
characteristics: characteristics:
* Product Type = Service * Product Type = Service
* Procurement Method (Order fulfillment) = MTO (Make to Order) * Create Task Automatically = True
* Supply/Procurement Method = Manufacture
If on top of that a projet is specified on the product form (in the Procurement If on top of that a project is specified on the product form (in the Procurement
tab), then the new task will be created in that specific project. Otherwise, the tab), then the new task will be created in that specific project. Otherwise, the
new task will not belong to any project, and may be added to a project manually new task will not belong to any project, and may be added to a project manually
later. later.
+5 -2
View File
@@ -39,8 +39,11 @@
groups="base.group_user" groups="base.group_user"
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/> on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
</xpath> </xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="attributes"> <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="replace">
<attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)</attribute> <field name="product_id"
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
groups="base.group_user"
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
</xpath> </xpath>
<xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="attributes"> <xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="attributes">
<attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute> <attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>