[18.0][IMP] project_timesheet_time_control: Add search functionality for date_time_end and improve computation for end time based on day unit#1609
Conversation
|
Hi @victoralmau, |
|
@lbarry-apsl could you also have a look at this. I think you have the same issue. Thank you. |
7e76b86 to
bd82f59
Compare
|
@victoralmau could you please review? |
pedrobaeza
left a comment
There was a problem hiding this comment.
Is SQL totally needed in this case?
| def _search_date_time_end(self, operator, value): | ||
| # reference value is 1 day == 8 hours | ||
| hour_uom = self.env.ref("uom.product_uom_hour") | ||
|
|
There was a problem hiding this comment.
Please don't add empty lines inside methods (being also consistent with existing code).
|
@pedrobaeza do you have another suggestion regarding the SQL? The date_time_end depends on date_time + (duration * unit_factor). I did not find a solution to query this without SQL. |
bd82f59 to
ce8c816
Compare
pedrobaeza
left a comment
There was a problem hiding this comment.
OK, let's go with the SQL. The alternative is to make a search with the desired elements, and then pass a domain ("id", "in", ...), but it can be less performant.
| } | ||
| ) | ||
| ) | ||
|
|
There was a problem hiding this comment.
Here you still have empty lines inside methods.
…te_time_end and improve computation for end time based on day unit
ce8c816 to
ac71461
Compare
pedrobaeza
left a comment
There was a problem hiding this comment.
Thanks for attending my nitpickings :)
/ocabot merge patch
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 56fbb1e. Thanks a lot for contributing to OCA. ❤️ |
When you use hr_timesheet_calendar, the calendar control searches for date_time_end. Therefore there are a lot of errors in the log.