https://github.com/llonchj/godoo
Golang ODOO Client & Generator
https://github.com/llonchj/godoo
api go golang odoo
Last synced: 3 months ago
JSON representation
Golang ODOO Client & Generator
- Host: GitHub
- URL: https://github.com/llonchj/godoo
- Owner: llonchj
- Created: 2018-04-28T18:45:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T10:33:10.000Z (over 3 years ago)
- Last Synced: 2024-12-20T21:39:45.869Z (over 1 year ago)
- Topics: api, go, golang, odoo
- Language: Go
- Size: 7.33 MB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# godoo
Odoo API client for Go.
## Install
```bash
go install github.com/llonchj/godoo@latest
```
## Using the API
This is an example of how create a new sale order :
```go
package main
//go:generate godoo add all --uri http://localhost:8069 --database test --username admin --password password
import (
"fmt"
"github.com/llonchj/godoo/api"
)
func main() {
config := &api.Config{
DbName: "test",
Admin: "admin",
Password: "password",
URI: "http://localhost:8069",
}
c, err := config.NewClient()
if err != nil {
fmt.Println(err.Error())
}
err = c.CompleteSession()
if err != nil {
fmt.Println(err.Error())
}
//get the sale order service
s := api.NewSaleOrderService(c)
//call the function GetAll() linked to the sale order service
so, err := s.GetAll()
if err != nil {
fmt.Println(err.Error())
}
fmt.Println(so)
}
```
## ToDo
- Tests
- Version support (8-9-10-11)
- Printing based on version ()
- New Odoo API functions
- [Workflow Signals](https://www.odoo.com/documentation/8.0/api_integration.html#workflow-manipulations)
- [Report printing](https://www.odoo.com/documentation/8.0/api_integration.html#report-printing)
```
docker compose run odoo odoo -i base -d odoo --stop-after-init
```