Merge lp:~pedro.baeza/hr-timesheet/7.0-hr_timesheet_task-imp into lp:~hr-core-editors/hr-timesheet/7.0

Proposed by Pedro Manuel Baeza
Status: Merged
Merged at revision: 68
Proposed branch: lp:~pedro.baeza/hr-timesheet/7.0-hr_timesheet_task-imp
Merge into: lp:~hr-core-editors/hr-timesheet/7.0
Diff against target: 100 lines (+17/-38)
3 files modified
hr_timesheet_task/hr_analytic_timesheet_view.xml (+14/-35)
hr_timesheet_task/hr_timesheet_sheet_view.xml (+0/-1)
timesheet_task/project_task.py (+3/-2)
To merge this branch: bzr merge lp:~pedro.baeza/hr-timesheet/7.0-hr_timesheet_task-imp
Reviewer Review Type Date Requested Status
Stéphane Bidoul (Acsone) (community) code review, no test Approve
Yannick Vaucher @ Camptocamp code review, no test Approve
Review via email: mp+219821@code.launchpad.net

Description of the change

[FIX] hr_timesheet_sheet: Fix error if there is no project associated to task.
[FIX] hr_timesheet_sheet: Tree view for hr.analytic.timesheet inherited instead of overwritten, to allow other modules to modifiy this view (for example, hr_timesheet_department).
[IMP] hr_timesheet_sheet: Remove obsolete type labels on XML views.

To post a comment you must log in.
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Pedro,

Can you explain the use case where you need to enter time on tasks in other state than done?

Domains such as this one may vary from a company to another, but I thought allowing only open tasks was a good default?

Thanks!

review: Needs Information (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I think now in two possible scenarios:

- Bad configured project provokes that initial state of a task is not set.
- There is a third person that inputs all times. I'm thinking now that tasks can be also even in done state, because inputation is done afterwards.

Do you think there is a better way?

Regards.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

In that case I would change de domain in an additional module that is perhaps specific to your use case, because I believe current users of hr_timesheet_task expect to see only open tasks.

review: Needs Fixing
65. By Pedro Manuel Baeza

Domain of task field reverted to original state.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I have reverted back to original domain. Please review rest of the changes.

Regards.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) :
review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_timesheet_task/hr_analytic_timesheet_view.xml'
--- hr_timesheet_task/hr_analytic_timesheet_view.xml 2013-04-10 16:14:47 +0000
+++ hr_timesheet_task/hr_analytic_timesheet_view.xml 2014-05-16 13:48:18 +0000
@@ -1,56 +1,35 @@
1<openerp>1<openerp>
2 <data>2 <data>
3 #---------------------------------------------------------------------------------------------------------3 <!-- Add task on hr.analytic.timesheet -->
4 # Add task on hr.analytic.timesheet4 <record id="hr_timesheet_line_form" model="ir.ui.view">
5 #---------------------------------------------------------------------------------------------------------
6 <record id="hr_timesheet_line_form" model="ir.ui.view">
7 <field name="name">hr.analytic.timesheet.form</field>5 <field name="name">hr.analytic.timesheet.form</field>
8 <field name="model">hr.analytic.timesheet</field>6 <field name="model">hr.analytic.timesheet</field>
9 <field name="type">form</field>
10 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>7 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
11 <field name="arch" type="xml">8 <field name="arch" type="xml">
12 <field name="user_id" position="after">9 <field name="user_id" position="after">
13 <field name="task_id" context="{ 'account_id' : account_id}"10 <field name="task_id"
14 domain="[('state','=','open'), ('project_id.analytic_account_id','=',account_id)]"/>11 context="{'account_id': account_id}"
12 domain="[('state', '=', 'open'), ('project_id.analytic_account_id','=',account_id)]"/>
15 </field>13 </field>
16 </field>14 </field>
17 </record>15 </record>
18 <record id="hr_timesheet.hr_timesheet_line_tree" model="ir.ui.view">16 <record id="hr_timesheet_line_tree" model="ir.ui.view">
19 <field name="name">hr.analytic.timesheet.tree</field>17 <field name="name">hr.analytic.timesheet.tree</field>
20 <field name="model">hr.analytic.timesheet</field>18 <field name="model">hr.analytic.timesheet</field>
21 <field name="type">tree</field>19 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
22 <field name="priority">2</field>
23 <field name="arch" type="xml">20 <field name="arch" type="xml">
24 <tree editable="top" string="Timesheet Lines">21 <field name="account_id" position="after">
25 <field name="date" on_change="on_change_date(date)"/>22 <field name="task_id"
26 <field domain="[('type','=','normal'), ('state','=','open')]" name="account_id"/>23 context="{'account_id': account_id}"
27 <field name="task_id" context="{'account_id' : account_id}"24 domain="[('state', '=', 'open'), ('project_id.analytic_account_id','=',account_id)]"/>
28 domain="[('state','=','open'), ('project_id.analytic_account_id','=',account_id)]"/>25 </field>
29 <field name="name"/>
30 <field name="unit_amount"
31 on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id, journal_id)"
32 sum="Total time" widget="float_time"/>
33 <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
34 <field name="journal_id" invisible="1"/>
35 <field name="product_id"
36 on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id, journal_id)"
37 required="1" domain="[('type','=','service')]" invisible="1"/>
38 <field name="product_uom_id"
39 on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id, journal_id)"
40 invisible="1"/>
41 <field name="amount" sum="Total cost" invisible="1"/>
42 <field name="general_account_id" invisible="1"/>
43 </tree>
44 </field>26 </field>
45 </record>27 </record>
46 #---------------------------------------------------------------------------------------------------------28 <!-- Add task on search hr.analytic.timesheet -->
47 # Add task on search hr.analytic.timesheet29 <record id="hr_timesheet_line_search" model="ir.ui.view">
48 #---------------------------------------------------------------------------------------------------------
49 <record id="hr_timesheet_line_search" model="ir.ui.view">
50 <field name="name">hr.analytic.timesheet.search</field>30 <field name="name">hr.analytic.timesheet.search</field>
51 <field name="model">hr.analytic.timesheet</field>31 <field name="model">hr.analytic.timesheet</field>
52 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>32 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
53 <field name="type">search</field>
54 <field name="arch" type="xml">33 <field name="arch" type="xml">
55 <field name="date" position="after">34 <field name="date" position="after">
56 <field name="task_id"/>35 <field name="task_id"/>
5736
=== modified file 'hr_timesheet_task/hr_timesheet_sheet_view.xml'
--- hr_timesheet_task/hr_timesheet_sheet_view.xml 2013-03-28 17:30:55 +0000
+++ hr_timesheet_task/hr_timesheet_sheet_view.xml 2014-05-16 13:48:18 +0000
@@ -6,7 +6,6 @@
6 <field name="name">hr_timesheet_sheet.sheet.filter</field>6 <field name="name">hr_timesheet_sheet.sheet.filter</field>
7 <field name="model">hr_timesheet_sheet.sheet</field>7 <field name="model">hr_timesheet_sheet.sheet</field>
8 <field name="inherit_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_filter"/>8 <field name="inherit_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_filter"/>
9 <field name="type">search</field>
10 <field name="arch" type="xml">9 <field name="arch" type="xml">
11 <filter name="to_approve" position="after">10 <filter name="to_approve" position="after">
12 <separator orientation="vertical"/>11 <separator orientation="vertical"/>
1312
=== modified file 'timesheet_task/project_task.py'
--- timesheet_task/project_task.py 2014-05-06 08:36:59 +0000
+++ timesheet_task/project_task.py 2014-05-16 13:48:18 +0000
@@ -58,8 +58,9 @@
58 # project triggers on task are not called58 # project triggers on task are not called
59 res = super(ProjectTask, self)._store_set_values(cr, uid, ids, fields, context=context)59 res = super(ProjectTask, self)._store_set_values(cr, uid, ids, fields, context=context)
60 for row in self.browse(cr, SUPERUSER_ID, ids, context=context):60 for row in self.browse(cr, SUPERUSER_ID, ids, context=context):
61 project = row.project_id61 if row.project_id:
62 project.write({'parent_id': project.parent_id.id})62 project = row.project_id
63 project.write({'parent_id': project.parent_id.id})
63 return res64 return res
6465
6566

Subscribers

People subscribed via source and target branches