HR_Holidays - Declare negative days

Bug #540946 reported by LudoRA
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
JMA(Open ERP)

Bug Description

Hi!

In th hr_holidays addon, it's indicate:
- An employee can make a negative holiday request (holiday request of -2 days for example), this is considered by the system as an ask for more off-days. It will increase his total of that holiday status available (if the request is accepted).

Despite of this description, I tested this function and I have an error message when I demand -2 holiday, 18/03/2010 17:36:00 to 19/03/2010 09:37:00 .

The error message is:
> /home/ludo/Programmes/openerp-server-5.0.7/bin/osv/orm.py(927)_validate()
-> raise except_orm('ValidateError', '\n'.join(error_msgs))

______
Openerp server 5.0.7

Related branches

Changed in openobject-addons:
assignee: nobody → JMA(Open ERP) (jma-openerp)
Changed in openobject-addons:
status: New → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Fixed by revision 2669 <email address hidden>.
Kindly have an update and recheck.
Thank you for reporting.

Changed in openobject-addons:
importance: Undecided → Medium
milestone: none → 5.0.8
status: In Progress → Fix Released
Revision history for this message
LudoRA (tenshi20) wrote :

Hi!

I'm just testing this module with 5.0.9 version.
I've got the same problem. Impossible to declare negative holiday.

File "/home/ludo/Programmes/openerp-client-5.0.9/bin/tiny_socket.py", line 81, in myreceive
    raise Myexception(str(res[0]), str(res[1]))
tiny_socket.Myexception: ('warning -- ValidateError\n\nError occurred while validating the field(s) number_of_days: Start date should not be larger than end date!\nNumber of Days should be greater than 1!', 'Traceback (most recent call last):\n File "/home/ludo/Programmes/openerp-server-5.0.9/bin/netsvc.py", line 245, in dispatch\n result = LocalService(service_name)(method, *params)\n File "/home/ludo/Programmes/openerp-server-5.0.9/bin/netsvc.py", line 74, in __call__\n return getattr(self, method)(*params)\n File "/home/ludo/Programmes/openerp-server-5.0.9/bin/service/web_services.py", line 576, in execute\n res = service.execute(db, uid, object, method, *args)\n File "/home/ludo/Programmes/openerp-server-5.0.9/bin/osv/osv.py", line 63, in wrapper\n self.abortResponse(1, inst.name, \'warning\', inst.value)\n File "/home/ludo/Programmes/openerp-server-5.0.9/bin/netsvc.py", line 59, in abortResponse\n raise Exception("%s -- %s\\n\\n%s"%(origin, description, details))\nException: warning -- ValidateError\n\nError occurred while validating the field(s) number_of_days: Start date should not be larger than end date!\nNumber of Days should be greater than 1!\n')

Revision history for this message
LudoRA (tenshi20) wrote :

I test another time with the 5.0.12 version.
It is not fixed anymore.

Changed in openobject-addons:
status: Fix Released → Confirmed
Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello LudoRA,

When you try to save the record the constraint gets called, which wont allow you to have a leave request for negative days.
Example;
From: 2010/08/15 To: 2010/08/20 Days: 5

From: 2010/08/20 To: 2010/08/15 Days: -5

For the latter instance it wont allow you, will always fire the constraint.
Start date should always be greater than the End date.
There usually seems no point to have a negative holiday request.

Let us know if you have further queries regarding the issue.

I hope this helps.

Thank you.

Changed in openobject-addons:
status: Confirmed → Fix Released
LudoRA (tenshi20)
Changed in openobject-addons:
status: Fix Released → Incomplete
Revision history for this message
LudoRA (tenshi20) wrote :

According to the documentation, it's possible to declare negative days. It should be very useful for me.

If this module can't be used like its description, there are 2 possibilities:
1. Change the documentation
2. Develop the module to permit user to declare negatives days

LudoRA (tenshi20)
Changed in openobject-addons:
status: Incomplete → Confirmed
Revision history for this message
Samantha (samantha-z-mathews) wrote :

this is a generic product and not for personal use.
you better customise for your use. my customers dont need negative holidays and i prefer to see what openerp currently behaves.

thanks anyways Ludora. this is really not a bug.

Revision history for this message
LudoRA (tenshi20) wrote :

OK. I can understand this.
But, I repeat: if it's not a functionnality of this module, it's important to change its description. Because, declare negative day functionnality is precised inside: <quote>- An employee can make a negative holiday request (holiday request of -2 days for example), this is considered by the system as an ask for more off-days. It will increase his total of that holiday status available (if the request is accepted). </quote>

Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
milestone: 5.0.8 → 5.0.15
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Ludo Chevalier,

Thanks for bringing this into notice.

We have introduced a patch which would allow holiday requests all except following reasons:

1. Start date is greater than End date.
2. Number of Day(s) asked for leave(s) are zero.
3. You are requesting more holidays by putting negative days,but both the dates are not same.

Let me know if we need more clear approach.

Queries/Discussions invited.
Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Expert commented needed.
Thanks.

Revision history for this message
LudoRA (tenshi20) wrote :

Sorry. But, where can I download the version to test of this new plugin???

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Ludora,

It's not a plug-in. Just apply the attached patch from response #8.
I hope this helps you.
Thank you.

Revision history for this message
LudoRA (tenshi20) wrote :

Is it normal that your patch seems to be the result of the diff command?

Not easy to apply this patch, no?

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Ludora,

Yes, the patch is the outcome of the diff command.

If you are unable to apply the patch, you may replace hr.py with the file in the attachment.

I hope this helps you.

Let me know if you have nay further queries.

Thanks.

Revision history for this message
LudoRA (tenshi20) wrote :

OK. I've just tested it. It works fine.

Just, it could be very useful if we could specify the right dates.

Thanks for this patch.

Will this patch be integrated to the future version of the plugin?

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hi Ludora,

The patch would be integrated in the latest stable version release.
However, the trunk version already contains better code.

Thank you.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for the response Ludora,

Fix has been pushed to the stable branch by revision 2873 <email address hidden>.

Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
LudoRA (tenshi20) wrote :

Thanks a lot for your work Jay.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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