Documentation ¶
Index ¶
- func StringToCommand(cmd *Command, str string) error
- type Command
- func (cmd *Command) AreFieldsUpdated() bool
- func (cmd *Command) GoToFirstPage(rotate bool) bool
- func (cmd *Command) GoToLastPage(rotate bool) bool
- func (cmd *Command) GoToNextPage(rotate bool) bool
- func (cmd *Command) GoToPage(page int, rotate bool) bool
- func (cmd *Command) GoToPreviousPage(rotate bool) bool
- func (cmd *Command) SetFieldsUpdated()
- func (cmd *Command) SetID(id int)
- func (cmd *Command) UpdateCommandFields(server *Server, odooCfg *OdooConfig) error
- func (cmd *Command) UseAllFields()
- type OdooConfig
- type OdooContext
- type OdooError
- type OdooFieldInfo
- type OdooFieldsResult
- type OdooFieldsViewGetResult
- type OdooMetadataItem
- type OdooMetadataResult
- type OdooNameGetResult
- type OdooReadResult
- type OdooResponse
- type OdooResponseData
- type OdooSearchResult
- type OdooTree
- type OdooUserResult
- type RelatedCommand
- func GetRelatedCommand(model string, rcmds []RelatedCommand) (rcmd RelatedCommand, err error)
- func GetRelatedCommands(odoocfg *OdooConfig, lastCommand *Command) ([]RelatedCommand, error)
- func NewRelatedCommand(odooCfg *OdooConfig, model string, field string, ids []int, description string, ...) *RelatedCommand
- type Server
- func (server *Server) Authenticate(odooCfg *OdooConfig) (OdooResponse, error)
- func (server *Server) CallDB(odooCfg *OdooConfig, method string) (OdooResponse, error)
- func (server *Server) CallObject(odooCfg *OdooConfig, object string, method string, args ...interface{}) (OdooResponse, error)
- func (server *Server) Count(cmd *Command, odooCfg *OdooConfig) (int, error)
- func (server *Server) Fields(cmd *Command, odooCfg *OdooConfig) (OdooFieldsResult, error)
- func (server *Server) FieldsTree(cmd *Command, odooCfg *OdooConfig) ([]string, error)
- func (server *Server) FieldsViewGet(cmd *Command, odooCfg *OdooConfig) ([]string, error)
- func (server Server) GetName() string
- func (server *Server) GetServerVersion(odooCfg *OdooConfig) (string, error)
- func (server *Server) ListDatabases(odooCfg *OdooConfig) ([]string, error)
- func (server *Server) Metadata(cmd *Command, odooCfg *OdooConfig) (OdooMetadataResult, error)
- func (server *Server) NameGet(cmd *Command, odooCfg *OdooConfig) (OdooNameGetResult, error)
- func (server *Server) Read(cmd *Command, ids []int, odooCfg *OdooConfig) (OdooReadResult, error)
- func (server *Server) ReadOneFieldX2Many(fieldName string, relation string, x2ManyData X2ManyResult, fieldIDs []int, ...) error
- func (server *Server) ReadX2Many(cmd *Command, data OdooReadResult, odooCfg *OdooConfig) (X2ManyResult, error)
- func (server *Server) Search(cmd *Command, odooCfg *OdooConfig) (OdooSearchResult, error)
- func (server *Server) SearchRead(cmd *Command, odooCfg *OdooConfig) (OdooReadResult, error)
- type X2ManyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringToCommand ¶
Types ¶
type Command ¶
type Command struct { Description string Model string Domain [][]interface{} Limit int Offset int Fields []string IDS []int AllFields OdooFieldsResult FieldsUpdated bool Order string Page int Pages int Count int Context OdooContext }
func NewCommand ¶
func NewCommand(odooCfg *OdooConfig, model string, domain [][]interface{}, fields []string, limit int, order string, context OdooContext) *Command
func NewCommandIDs ¶ added in v0.2.0
func (*Command) AreFieldsUpdated ¶ added in v0.2.0
func (*Command) GoToFirstPage ¶
func (*Command) GoToLastPage ¶
func (*Command) GoToNextPage ¶
func (*Command) GoToPreviousPage ¶
func (*Command) SetFieldsUpdated ¶ added in v0.2.0
func (cmd *Command) SetFieldsUpdated()
func (*Command) UpdateCommandFields ¶
func (cmd *Command) UpdateCommandFields(server *Server, odooCfg *OdooConfig) error
func (*Command) UseAllFields ¶ added in v0.2.0
func (cmd *Command) UseAllFields()
type OdooConfig ¶
type OdooContext ¶
type OdooContext map[string]interface{}
type OdooError ¶
type OdooError struct { Code int `json:"code"` Message string `json:"message"` Data OdooResponseData `json:"data"` }
type OdooFieldInfo ¶
type OdooFieldInfo struct { Description string `mapstructure:"string"` Type string `mapstructure:"type"` Relation string `mapstructure:"relation"` RelationField string `mapstructure:"relation_field"` Manual bool `mapstructure:"manual"` Required bool `mapstructure:"required"` Readonly bool `mapstructure:"readonly"` Selection []interface{} `mapstructure:"selection"` Store bool `mapstructure:"store"` CompanyDependent bool `mapstructure:"company_dependent"` Searchable bool `mapstructure:"searchable"` Sortable bool `mapstructure:"sortable"` }
type OdooFieldsResult ¶
type OdooFieldsResult map[string]OdooFieldInfo
type OdooFieldsViewGetResult ¶
type OdooMetadataItem ¶ added in v0.2.0
type OdooMetadataItem struct { ID int `mapstructure:"id"` XMLID interface{} `mapstructure:"xmlid"` NoUpdate interface{} `mapstructure:"noupdate"` CreateUID []interface{} `mapstructure:"create_uid"` CreateDate interface{} `mapstructure:"create_date"` WriteUID []interface{} `mapstructure:"write_uid"` WriteDate interface{} `mapstructure:"write_date"` }
type OdooMetadataResult ¶ added in v0.2.0
type OdooMetadataResult []OdooMetadataItem
type OdooNameGetResult ¶
type OdooNameGetResult [][]interface{}
type OdooReadResult ¶
type OdooReadResult []map[string]interface{}
type OdooResponse ¶
type OdooResponseData ¶
type OdooResponseData struct { Name string `json:"name"` Message string `json:"message"` Debug string `json:"debug"` Arguments []interface{} `json:"arguments"` Context OdooContext `json:"context"` }
type OdooSearchResult ¶
type OdooSearchResult []int
type OdooTree ¶
type OdooTree struct { XMLName xml.Name `xml:"tree"` Text string `xml:",chardata"` String string `xml:"string,attr"` Field []struct { Text string `xml:",chardata"` Name string `xml:"name,attr"` String string `xml:"string,attr"` OnChange string `xml:"on_change,attr"` Modifiers string `xml:"modifiers,attr"` Invisible string `xml:"invisible,attr"` Class string `xml:"class,attr"` Optional string `xml:"optional,attr"` Widget string `xml:"widget,attr"` Domain string `xml:"domain,attr"` CanCreate string `xml:"can_create,attr"` CanWrite string `xml:"can_write,attr"` Readonly string `xml:"readonly,attr"` Options string `xml:"options,attr"` } `xml:"field"` }
type OdooUserResult ¶
type OdooUserResult struct { UID int `mapstructure:"uid"` IsAdmin bool `mapstructure:"is_admin"` UserContext OdooContext `mapstructure:"user_context"` ServerVersion string `mapstructure:"server_version"` }
type RelatedCommand ¶
type RelatedCommand struct { Model string Field string IDs []int Score int Description string Context OdooContext OriginField string Type string }
func GetRelatedCommand ¶ added in v0.2.0
func GetRelatedCommand(model string, rcmds []RelatedCommand) (rcmd RelatedCommand, err error)
func GetRelatedCommands ¶
func GetRelatedCommands(odoocfg *OdooConfig, lastCommand *Command) ([]RelatedCommand, error)
func NewRelatedCommand ¶
func NewRelatedCommand(odooCfg *OdooConfig, model string, field string, ids []int, description string, ttype string, context OdooContext) *RelatedCommand
func (*RelatedCommand) GetCommand ¶
func (rcmd *RelatedCommand) GetCommand(odooCfg *OdooConfig) *Command
func (*RelatedCommand) SetIDs ¶
func (rcmd *RelatedCommand) SetIDs(ids []int)
type Server ¶
func (*Server) Authenticate ¶
func (server *Server) Authenticate(odooCfg *OdooConfig) (OdooResponse, error)
func (*Server) CallDB ¶ added in v0.2.0
func (server *Server) CallDB(odooCfg *OdooConfig, method string) (OdooResponse, error)
func (*Server) CallObject ¶
func (server *Server) CallObject(odooCfg *OdooConfig, object string, method string, args ...interface{}) (OdooResponse, error)
func (*Server) Fields ¶
func (server *Server) Fields(cmd *Command, odooCfg *OdooConfig) (OdooFieldsResult, error)
func (*Server) FieldsTree ¶
func (server *Server) FieldsTree(cmd *Command, odooCfg *OdooConfig) ([]string, error)
func (*Server) FieldsViewGet ¶
func (server *Server) FieldsViewGet(cmd *Command, odooCfg *OdooConfig) ([]string, error)
func (*Server) GetServerVersion ¶ added in v0.2.0
func (server *Server) GetServerVersion(odooCfg *OdooConfig) (string, error)
func (*Server) ListDatabases ¶ added in v0.2.0
func (server *Server) ListDatabases(odooCfg *OdooConfig) ([]string, error)
func (*Server) Metadata ¶ added in v0.2.0
func (server *Server) Metadata(cmd *Command, odooCfg *OdooConfig) (OdooMetadataResult, error)
func (*Server) NameGet ¶
func (server *Server) NameGet(cmd *Command, odooCfg *OdooConfig) (OdooNameGetResult, error)
func (*Server) Read ¶
func (server *Server) Read(cmd *Command, ids []int, odooCfg *OdooConfig) (OdooReadResult, error)
func (*Server) ReadOneFieldX2Many ¶
func (server *Server) ReadOneFieldX2Many(fieldName string, relation string, x2ManyData X2ManyResult, fieldIDs []int, odooCfg *OdooConfig) error
func (*Server) ReadX2Many ¶
func (server *Server) ReadX2Many(cmd *Command, data OdooReadResult, odooCfg *OdooConfig) (X2ManyResult, error)
func (*Server) Search ¶
func (server *Server) Search(cmd *Command, odooCfg *OdooConfig) (OdooSearchResult, error)
func (*Server) SearchRead ¶
func (server *Server) SearchRead(cmd *Command, odooCfg *OdooConfig) (OdooReadResult, error)
type X2ManyResult ¶
Click to show internal directories.
Click to hide internal directories.