[Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
Alexis de Lattre has proposed merging lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet. Requested reviews: HR Core Editors (hr-core-editors) Related bugs: Bug #1316456 in HR - Timesheet Management: "hr_timesheet_task : can't save new task : "Analytic Account" field is invalid" https://bugs.launchpad.net/hr-timesheet/+bug/1316456 For more details, see: https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 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. -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team HR Core Editors is requested to review the proposed merge of lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet. === modified file 'timesheet_task/project_task.py' --- timesheet_task/project_task.py 2013-10-08 11:06:18 + +++ timesheet_task/project_task.py 2014-05-06 08:39:54 + @@ -135,7 +135,8 @@ _name = "hr.analytic.timesheet" def on_change_unit_amount(self, cr, uid, sheet_id, prod_id, unit_amount, company_id, - unit=False, journal_id=False, task_id=False, to_invoice=False, + unit=False, journal_id=False, task_id=False, + to_invoice=False, project_id=False, context=None): res = super(HrAnalyticTimesheet, self).on_change_unit_amount(cr, uid, @@ -146,9 +147,14 @@ unit, journal_id, context) -if 'value' in res and task_id: -task_obj = self.pool.get('project.task') -p = task_obj.browse(cr, uid, task_id).project_id +if 'value' in res and (task_id or project_id): +if task_id: +task_obj = self.pool.get('project.task') +p = task_obj.browse( +cr, uid, task_id, context=context).project_id +elif project_id: +p = self.pool['project.project'].browse( +cr, uid, project_id, context=context) if p: res['value']['account_id'] = p.analytic_account_id.id if p.to_invoice and not to_invoice: === modified file 'timesheet_task/project_task_view.xml' --- timesheet_task/project_task_view.xml 2013-04-24 12:53:33 + +++ timesheet_task/project_task_view.xml 2014-05-06 08:39:54 + @@ -76,7 +76,7 @@ required="1" invisible="1"/> @@ -209,4 +209,4 @@ - \ No newline at end of file + -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
[Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
The proposal to merge lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
[Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
The proposal to merge lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet has been updated. Status: Approved => Merged For more details, see: https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
Re: [Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
Review: Approve code review, no test LGTM -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
Re: [Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
Review: Approve code review LGTM. Regards. -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
Re: [Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
Review: Approve code review, no test Makes sense. -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp
Re: [Openerp-community-reviewer] [Merge] lp:~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456 into lp:hr-timesheet
Review: Approve code review, no test LGTM thanks for the fix -- https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364 Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:hr-timesheet. -- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp