Documentation ¶
Index ¶
- func BootStrap()
- func LoadActionFromEtree(element *etree.Element)
- func LoadMenuFromEtree(element *etree.Element)
- func LoadViewFromEtree(element *etree.Element)
- type ActionRef
- type ActionType
- type ActionViewType
- type ActionsCollection
- type BaseAction
- type MenuCollection
- type Toolbar
- type UiMenu
- type View
- type ViewInheritanceMode
- type ViewRef
- type ViewType
- type ViewsCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootStrap ¶
func BootStrap()
BootStrap computes all views, actions and menus after they have been added by the modules.
func LoadActionFromEtree ¶
LoadActionFromEtree reads the action given etree.Element, creates or updates the action and adds it to the action registry if it not already.
func LoadMenuFromEtree ¶
LoadMenuFromEtree reads the menu given etree.Element, creates or updates the menu and adds it to the menu registry if it not already.
func LoadViewFromEtree ¶
LoadViewFromEtree reads the view given etree.Element, creates or updates the view and adds it to the view registry if it not already.
Types ¶
type ActionRef ¶
type ActionRef [2]string
ActionRef is an array of two strings representing an action: - The first one is the ID of the action - The second one is the name of the action
func MakeActionRef ¶
type ActionType ¶
type ActionType string
const ( ACTION_ACT_WINDOW ActionType = "ir.actions.act_window" ACTION_SERVER ActionType = "ir.actions.server" )
type ActionViewType ¶
type ActionViewType string
const ( ACTION_VIEW_TYPE_FORM ActionViewType = "form" ACTION_VIEW_TYPE_TREE ActionViewType = "tree" )
type ActionsCollection ¶
var ActionsRegistry *ActionsCollection
func NewActionsCollection ¶
func NewActionsCollection() *ActionsCollection
NewActionCollection returns a pointer to a new ActionsCollection instance
func (*ActionsCollection) AddAction ¶
func (ar *ActionsCollection) AddAction(a *BaseAction)
AddAction adds the given action to our ActionsCollection
func (*ActionsCollection) GetActionById ¶
func (ar *ActionsCollection) GetActionById(id string) *BaseAction
GetActionById returns the Action with the given id
type BaseAction ¶
type BaseAction struct { ID string `json:"id"` Type ActionType `json:"type"` Name string `json:"name"` Model string `json:"res_model"` ResID int64 `json:"res_id"` Groups []string `json:"groups_id"` Domain string `json:"domain"` Help string `json:"help"` SearchView ViewRef `json:"search_view_id"` SrcModel string `json:"src_model"` Usage string `json:"usage"` //Flags interface{}`json:"flags"` Views []ViewRef `json:"views"` View ViewRef `json:"view_id"` AutoRefresh bool `json:"auto_refresh"` ManualSearch bool `json:"-"` ActViewType ActionViewType `json:"-"` ViewMode string `json:"view_mode"` ViewIds []string `json:"view_ids"` Multi bool `json:"multi"` Target string `json:"target"` AutoSearch bool `json:"auto_search"` //SearchView string `json:"search_view"` Filter bool `json:"filter"` Limit int64 `json:"limit"` Context tools.Context `json:"context"` }
type MenuCollection ¶
type MenuCollection struct { sync.RWMutex Menus []*UiMenu // contains filtered or unexported fields }
var MenusRegistry *MenuCollection
func NewMenuCollection ¶
func NewMenuCollection() *MenuCollection
NewMenuCollection returns a pointer to a new MenuCollection instance
func (*MenuCollection) AddMenu ¶
func (mc *MenuCollection) AddMenu(m *UiMenu)
AddMenu adds a menu to the menu registry
func (*MenuCollection) GetMenuById ¶
func (mc *MenuCollection) GetMenuById(id string) *UiMenu
GetMenuById returns the Menu with the given id
func (*MenuCollection) Len ¶
func (mr *MenuCollection) Len() int
func (*MenuCollection) Less ¶
func (mr *MenuCollection) Less(i, j int) bool
func (*MenuCollection) Swap ¶
func (mr *MenuCollection) Swap(i, j int)
type Toolbar ¶
type Toolbar struct { Print []*BaseAction `json:"print"` Action []*BaseAction `json:"action"` Relate []*BaseAction `json:"relate"` }
type UiMenu ¶
type UiMenu struct { ID string Name string Parent *UiMenu ParentCollection *MenuCollection Children *MenuCollection Sequence uint8 Action *BaseAction HasChildren bool HasAction bool }
type View ¶
type View struct { ID string `json:"id"` Name string `json:"name"` Model string `json:"model"` Type ViewType `json:"type"` Priority uint8 `json:"priority"` Arch string `json:"arch"` InheritID *View `json:"inherit_id"` InheritChildrenIDs []*View `json:"inherit_children_ids"` FieldParent string `json:"field_parent"` InheritanceMode ViewInheritanceMode `json:"mode"` Fields []string }
type ViewInheritanceMode ¶
type ViewInheritanceMode string
const ( VIEW_PRIMARY ViewInheritanceMode = "primary" VIEW_EXTENSION ViewInheritanceMode = "extension" )
type ViewRef ¶
type ViewRef [2]string
func MakeViewRef ¶
type ViewType ¶
type ViewType string
const ( VIEW_TYPE_TREE ViewType = "tree" VIEW_TYPE_LIST ViewType = "list" VIEW_TYPE_FORM ViewType = "form" VIEW_TYPE_GRAPH ViewType = "graph" VIEW_TYPE_CALENDAR ViewType = "calendar" VIEW_TYPE_DIAGRAM ViewType = "diagram" VIEW_TYPE_GANTT ViewType = "gantt" VIEW_TYPE_KANBAN ViewType = "kanban" VIEW_TYPE_SEARCH ViewType = "search" VIEW_TYPE_QWEB ViewType = "qweb" )
type ViewsCollection ¶
var ViewsRegistry *ViewsCollection
func NewViewsCollection ¶
func NewViewsCollection() *ViewsCollection
NewViewCollection returns a pointer to a new ViewsCollection instance
func (*ViewsCollection) AddView ¶
func (vc *ViewsCollection) AddView(v *View)
AddView adds the given view to our ViewsCollection
func (*ViewsCollection) GetFirstViewForModel ¶
func (vc *ViewsCollection) GetFirstViewForModel(model string, viewType ViewType) *View
GetFirstViewForModel returns the first view of type viewType for the given model
func (*ViewsCollection) GetViewById ¶
func (vc *ViewsCollection) GetViewById(id string) *View
GetViewById returns the View with the given id