Skip to content

llonchj/godoo

Repository files navigation

godoo

Odoo API client for Go.

Install

go install github.com/llonchj/godoo@latest

Using the API

This is an example of how create a new sale order :

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

docker compose run odoo odoo -i base -d odoo --stop-after-init

About

Golang ODOO Client & Generator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages