Create timesheet record on a confirmed/done timesheet

Bug #1229866 reported by Juan José Scarafía (ADHOC)
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 1

Bug Description

In openerp 7.0
- Create new database (could be without demo)
- Install "project_timesheet"
- Go to human resource/my current timesheet. Save it
- Go to human resource/timesheet activities. Create one with actual date (it is on the timesheet we have just created)
- Go to human resource/my current timesheet. Click on "submit to manager" and then on "approve"
- Go to human resource/timesheet activities Create one with actual date (it is on the timesheet we have just close) No error given. Try to modify any saved record --> Constraint error "Error occurred while validating the field(s) state: You cannot modify an entry in a Confirmed/Done timesheet !"

Conclusion: Constraint error is only working on writing and not on creation.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → Invalid
Revision history for this message
Praveen Kumar (mailtoexpert) wrote :

This is not a bug.
It's a functionality of Timesheet

when You create a Timesheet then it is for current week.
and when You create a Timsheet Activity then Timesheet Activity automatically takes the default Timesheet according to Current Date and Time.

You cab See the attached Sheet in the Form view of Timesheet Activity. Field name is SHEET(which is a read only field and can not be modified).

You got Constraint Error because when You created Second Activity while sheet attached according to current date/time is already approved by you.

try with different date/time You won't get error.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello Praveen,

You misunderstood the report. Please try the described scenario and you will incur the same bug.

I put again this report as 'Confirmed' (I do so because it has already been confirmed by Christian).

Changed in openobject-addons:
status: Invalid → Confirmed
Revision history for this message
Praveen Kumar (mailtoexpert) wrote :

Hello Guewen,

I already tried Complete Scenario given by You and got the same constraint error.

But when I browsed the Code of the object then feel that it is a functionality.

if Christian is agree then it may be bug.

Revision history for this message
Ludo (Neobis) (ludo-neobis) wrote :

This bug also affects us. The same effect is applicable when some employee books hours on a task and confirms the timesheet, then another employee also books hours on the same task.

In my opinion it should only even check once per line. Just because the timesheet is meant for one week does not nesc. mean that it can only span for one week! The same goes for tasks. A task might very well span for over 4 weeks or more.
It would not just be a waste of resources but also not required to re-evaluate a line each time someone saves the object, especially not if he does not alter any line!

Revision history for this message
Ilja Schumacher (ilja.schumacher) wrote :

I support Ludo on this Topic.
This functionality should be more flexible.

What I also tried was:

1. Finish and Approve Timesheet for this week.
2. Create a New Timesheet for NextWeek.
3. Try to file an Timesheet entry Dated for Next Week (in advance) via the Task in the project.
4. Same error.

The "class project_work() def write:" should check for the date field in the TaskWork line and select the corresponding Timesheet instead of using the current datetime and picking the already approved timesheet again.

tags: added: project timesheet
Revision history for this message
Ludo (Neobis) (ludo-neobis) wrote :

Is anything known about this bug? For instance, is it already qualified as a bug? And if so, is this still viable for OpenERP v7, or will it only be fixed in v8+?

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.