markciecior / ConnectPyse

ConnectWise (Manage) REST API client written in Python 3.x
MIT License
21 stars 8 forks source link

Add Time Sheet controls #12

Closed wesgann closed 3 years ago

wesgann commented 3 years ago

Allows time sheets to be gotten, approved, rejected, reversed, and submitted.

markciecior commented 3 years ago

Thanks, @wesgann , I'll look at this in the next few days and bump PyPi when merged.

wesgann commented 3 years ago

@markciecior No problem! I'm actively using this PR. I also have another modification that I made, which was really simple but I added "fields" to go with the conditions and orderBy. I was just going to create a separate PR for that after this was approved.

Fields allows you select which fields you want returned from CW. It can greatly reduce the response time! (You can try it in Postman - ex: &fields=id,status will just return the id and status fields). Your code will still display the whole model instead of the selected fields, the model will just default to None for whatever fields were not included. Postman or other calls will only return the fields you select which aside from being faster, also reduces bandwidth which can be helpful if you're making a lot of calls.

If you don't want to wait for the PR, just add self.fields = '' to CWController's init method and in the _format_user_params method, add "fields" to the list that param is comparing against.

markciecior commented 3 years ago

PyPi bumped to 0.5.0.9