Merge lp:~sbi/c2c-addons/6.1-timesheet_task_fix into lp:c2c-addons/6.1

Proposed by Stéphane Bidoul (Acsone)
Status: Merged
Merged at revision: 110
Proposed branch: lp:~sbi/c2c-addons/6.1-timesheet_task_fix
Merge into: lp:c2c-addons/6.1
Diff against target: 36 lines (+6/-9)
2 files modified
hr_timesheet_task/hr_analytic_timesheet_view.xml (+0/-3)
timesheet_task/project_task.py (+6/-6)
To merge this branch: bzr merge lp:~sbi/c2c-addons/6.1-timesheet_task_fix
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp Pending
Review via email: mp+122489@code.launchpad.net

Description of the change

In timesheet_task, the on_change event mixes the project id and analytic account id. Indeed, the account_id field in hr.analytic.timesheet is an analytic account, not a project.

To post a comment you must log in.
106. By Stéphane Bidoul (Acsone)

remove reference to non-existent fields unit_amount and hours_to_inv

107. By Stéphane Bidoul (Acsone)

Merge from upstream

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_task/hr_analytic_timesheet_view.xml'
2--- hr_timesheet_task/hr_analytic_timesheet_view.xml 2012-05-02 13:27:15 +0000
3+++ hr_timesheet_task/hr_analytic_timesheet_view.xml 2012-09-16 15:18:21 +0000
4@@ -13,9 +13,6 @@
5 <field name="task_id" context="{ 'account_id' : account_id}"
6 domain="[('state','=','open')]"/>
7 </xpath>
8- <xpath expr="/form/notebook/group/field[@name='unit_amount']" position="after">
9- <field name="hours_to_inv"/>
10- </xpath>
11 </field>
12 </record>
13 <record id="hr_timesheet.hr_timesheet_line_tree" model="ir.ui.view">
14
15=== modified file 'timesheet_task/project_task.py'
16--- timesheet_task/project_task.py 2012-05-02 13:27:15 +0000
17+++ timesheet_task/project_task.py 2012-09-16 15:18:21 +0000
18@@ -106,12 +106,12 @@
19 journal_id,
20 context)
21 if 'value' in res and task_id:
22- proj_obj = self.pool.get('project.task')
23- aa = proj_obj.browse(cr, uid, task_id).project_id
24- if aa:
25- res['value']['account_id'] = aa.id
26- if aa.to_invoice and not to_invoice:
27- res['value']['to_invoice'] = aa.to_invoice.id
28+ task_obj = self.pool.get('project.task')
29+ p = task_obj.browse(cr, uid, task_id).project_id
30+ if p:
31+ res['value']['account_id'] = p.analytic_account_id.id
32+ if p.to_invoice and not to_invoice:
33+ res['value']['to_invoice'] = p.to_invoice.id
34 return res
35
36 HrAnalyticTimesheet()

Subscribers

People subscribed via source and target branches