This question has been flagged
8 Replies
3066 Views

I am new to OpenERP 7 and we hired a freelancer to do some work for us

we needed the date of the entry to be limited to today, yesterday and the day before it

The freelancer did limit it though the selection but if the user were to type the date manually, it will still accept the entry

I mentioned to him this loophole and how it would make problems for us, but he claims that he would need to change a js file and it would be hard to accomplish

I took his word but my manager wants to confirm that I have not been tricked hence, this question

So, how possible is it to accomplish the mentioned apove

Avatar
Discard

Hello Faez Abdulkareem,

Can you tell which field it is ? In which form ?

Author

if the default fleet module, fuel log form

the date field

As it is in form view, i think it is possible to restrict the date field to, today, yesterday and day before without using js

Author

he has done the restriction from the selection, but if the user were to type the date manually, the system would still accept

Other than making it as selection field, keep the field remain as same. And while before saving or give onchange function for this field & check whether entered date belongs to today,last day and day before. If not Show a error message/warning to select today, yesterday or day before

Author

from your comment this seems to be an easy thing to achieve, if so then could you instruct me on how to do it on my own?

Author Best Answer

The date picker is done, the issue is that the user can type the date manually in the text box without selecting it from the date picker

Avatar
Discard

its risky task , as your developer said

But we can restrict it, if we give some constrains and we can make it not possible to save if the date is not desired ones

Author

I will look more into this