Merge lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:~hr-core-editors/hr-timesheet/7.0

Proposed by Alexis de Lattre
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 64
Merged at revision: 65
Proposed branch: lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456
Merge into: lp:~hr-core-editors/hr-timesheet/7.0
Diff against target: 51 lines (+12/-6)
2 files modified
timesheet_task/project_task.py (+10/-4)
timesheet_task/project_task_view.xml (+2/-2)
To merge this branch: bzr merge lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no test Approve
Stéphane Bidoul (Acsone) (community) code review, no test Approve
Pedro Manuel Baeza code review Approve
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+218364@code.launchpad.net

Description of the change

I have fixed the bug https://bugs.launchpad.net/hr-timesheet/+bug/1316456 in this merge proposal. Please refer to the bug report to get a complete bug description with the scenario to reproduce it.

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM.

Regards.

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

Makes sense.

review: Approve (code review, no test)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM thanks for the fix

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 'timesheet_task/project_task.py'
--- timesheet_task/project_task.py 2013-10-08 11:06:18 +0000
+++ timesheet_task/project_task.py 2014-05-06 08:39:54 +0000
@@ -135,7 +135,8 @@
135 _name = "hr.analytic.timesheet"135 _name = "hr.analytic.timesheet"
136136
137 def on_change_unit_amount(self, cr, uid, sheet_id, prod_id, unit_amount, company_id,137 def on_change_unit_amount(self, cr, uid, sheet_id, prod_id, unit_amount, company_id,
138 unit=False, journal_id=False, task_id=False, to_invoice=False,138 unit=False, journal_id=False, task_id=False,
139 to_invoice=False, project_id=False,
139 context=None):140 context=None):
140 res = super(HrAnalyticTimesheet, self).on_change_unit_amount(cr,141 res = super(HrAnalyticTimesheet, self).on_change_unit_amount(cr,
141 uid,142 uid,
@@ -146,9 +147,14 @@
146 unit,147 unit,
147 journal_id,148 journal_id,
148 context)149 context)
149 if 'value' in res and task_id:150 if 'value' in res and (task_id or project_id):
150 task_obj = self.pool.get('project.task')151 if task_id:
151 p = task_obj.browse(cr, uid, task_id).project_id152 task_obj = self.pool.get('project.task')
153 p = task_obj.browse(
154 cr, uid, task_id, context=context).project_id
155 elif project_id:
156 p = self.pool['project.project'].browse(
157 cr, uid, project_id, context=context)
152 if p:158 if p:
153 res['value']['account_id'] = p.analytic_account_id.id159 res['value']['account_id'] = p.analytic_account_id.id
154 if p.to_invoice and not to_invoice:160 if p.to_invoice and not to_invoice:
155161
=== modified file 'timesheet_task/project_task_view.xml'
--- timesheet_task/project_task_view.xml 2013-04-24 12:53:33 +0000
+++ timesheet_task/project_task_view.xml 2014-05-06 08:39:54 +0000
@@ -76,7 +76,7 @@
76 required="1" invisible="1"/>76 required="1" invisible="1"/>
77 <field name="name" />77 <field name="name" />
78 <field name="unit_amount"78 <field name="unit_amount"
79 on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id, parent.id, to_invoice)"79 on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id, parent.id, to_invoice, parent.project_id, context)"
80 sum="Total time" widget="float_time" />80 sum="Total time" widget="float_time" />
81 <field name="date"81 <field name="date"
82 on_change="on_change_date(date)" />82 on_change="on_change_date(date)" />
@@ -209,4 +209,4 @@
209 </record>209 </record>
210210
211 </data>211 </data>
212</openerp>
213\ No newline at end of file212\ No newline at end of file
213</openerp>

Subscribers

People subscribed via source and target branches