Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [ADD] Check route to have a response on working code * [FIX] timesheet create on Odoo 12.0 models * [IMP] Token generation based on python3 * [IMP] Create timesheet for specific user * [REF] Refactoring user information Odoo crypt password now so every time we try to get it, we have an empty string. With old code every user password would have been overwritten. With this refactoring we use an admin/manager account to write data for other users but force on creation the right user reference. * [ADD] README and sample setting file Co-authored-by: Apruzzese Francesco <cescoap@gmail.com>
- Loading branch information
Showing
3 changed files
with
80 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
SENDTIME | ||
======== | ||
|
||
Configuration | ||
------------- | ||
|
||
Create your configuration file. If you need you can use ```settings.cfg.sample``` file as template | ||
|
||
Export configuration file path as environment data: | ||
|
||
``` | ||
$ export SENDTIME_SETTINGS=/your/config/file/path | ||
``` | ||
|
||
Run | ||
--- | ||
|
||
Run **sendtime** as a python script | ||
|
||
|
||
Test | ||
---- | ||
|
||
It's possible to test **sendtime** with curl. For example: | ||
|
||
### Check connection | ||
|
||
``` | ||
$ curl http://127.0.0.1:5000/check | ||
``` | ||
|
||
### Send data | ||
|
||
``` | ||
$ curl --header "Content-Type: application/json" --request POST --data '{"date":"2019-01-30","description":"Descrizione di test","duration":120,"project":"Progetto di Test"}' http://127.0.0.1:5000/api/timesheet | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEBUG = True | ||
SECRET_KEY = b'YOUR_KEY_HERE' | ||
ODOO_USER = 'admin' | ||
ODOO_PASSWORD = 'admin' | ||
ODOO_URI = 'http://localhost:8069' | ||
ODOO_DB = 'demo' |