hr_timesheet_task : can't save new task : "Analytic Account" field is invalid

Bug #1316456 reported by Alexis de Lattre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HR - Timesheet Management
Fix Committed
Undecided
Unassigned

Bug Description

I am using an up-to-date OpenERP with OCB 7.0 branches for addons+server+web. Here is the scenario of the bug :

1) Create a new DB with demo data.
2) Install the module "project_timesheet"
3) Go to the menu Project > Project > Projects
4) Click on the project "The Jackson Group's Project" : you will arrive on the kanban vue of tasks
5) Create a new Task and, immediately after, create a new work item (don't do a "save" in between)
6 ) Click on Save => it works well

Now, Install the module hr_timesheet_task from lp:hr-timesheet

Run the same scenario :

3') Go to the menu Project > Project > Projects
4') Click on the project "The Jackson Group's Project" : you will arrive on the kanban vue of tasks
5') Create a new Task and, immediately after, create a new work item (don't do a "save" in between)
6') Click on Save
=> it doesn't work and the following message is displayed to the user in the top right corner : "The following fields are invalid" : "Analytic Account".

Related branches

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

I have fixed the bug in the merge proposal https://code.launchpad.net/~akretion-team/hr-timesheet/70-fix-timesheet-task-bug1316456/+merge/218364

A few explainations about the bug and the fix : the field ""Analytic Account" (account_id) is a hidden field in the hr.analytic.timesheet line (=work items). In the scenario which is working, the field account_id is set by the on_change on the field unit_amount, which is the function on_change_unit_amount. But this on_change only works when the task has been saved. I have made a small modification to this on_change to make it work even when the task is not saved yet, by adding an argument project_id, and reading it via parent.project_id in the view.

Changed in hr-timesheet:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.