forked from Helvethink/go-odoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount_secure_entries_wizard.go
More file actions
125 lines (109 loc) · 5.59 KB
/
account_secure_entries_wizard.go
File metadata and controls
125 lines (109 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package odoo
// AccountSecureEntriesWizard represents account.secure.entries.wizard model.
type AccountSecureEntriesWizard struct {
ChainsToHashWithGaps *String `xmlrpc:"chains_to_hash_with_gaps,omitempty"`
CompanyId *Many2One `xmlrpc:"company_id,omitempty"`
CountryCode *String `xmlrpc:"country_code,omitempty"`
CreateDate *Time `xmlrpc:"create_date,omitempty"`
CreateUid *Many2One `xmlrpc:"create_uid,omitempty"`
DisplayName *String `xmlrpc:"display_name,omitempty"`
HashDate *Time `xmlrpc:"hash_date,omitempty"`
Id *Int `xmlrpc:"id,omitempty"`
MaxHashDate *Time `xmlrpc:"max_hash_date,omitempty"`
MoveToHashIds *Relation `xmlrpc:"move_to_hash_ids,omitempty"`
NotHashableUnlockedMoveIds *Relation `xmlrpc:"not_hashable_unlocked_move_ids,omitempty"`
UnreconciledBankStatementLineIds *Relation `xmlrpc:"unreconciled_bank_statement_line_ids,omitempty"`
Warnings *String `xmlrpc:"warnings,omitempty"`
WriteDate *Time `xmlrpc:"write_date,omitempty"`
WriteUid *Many2One `xmlrpc:"write_uid,omitempty"`
}
// AccountSecureEntriesWizards represents array of account.secure.entries.wizard model.
type AccountSecureEntriesWizards []AccountSecureEntriesWizard
// AccountSecureEntriesWizardModel is the odoo model name.
const AccountSecureEntriesWizardModel = "account.secure.entries.wizard"
// Many2One convert AccountSecureEntriesWizard to *Many2One.
func (asew *AccountSecureEntriesWizard) Many2One() *Many2One {
return NewMany2One(asew.Id.Get(), "")
}
// CreateAccountSecureEntriesWizard creates a new account.secure.entries.wizard model and returns its id.
func (c *Client) CreateAccountSecureEntriesWizard(asew *AccountSecureEntriesWizard) (int64, error) {
ids, err := c.CreateAccountSecureEntriesWizards([]*AccountSecureEntriesWizard{asew})
if err != nil {
return -1, err
}
if len(ids) == 0 {
return -1, nil
}
return ids[0], nil
}
// CreateAccountSecureEntriesWizard creates a new account.secure.entries.wizard model and returns its id.
func (c *Client) CreateAccountSecureEntriesWizards(asews []*AccountSecureEntriesWizard) ([]int64, error) {
var vv []interface{}
for _, v := range asews {
vv = append(vv, v)
}
return c.Create(AccountSecureEntriesWizardModel, vv, nil)
}
// UpdateAccountSecureEntriesWizard updates an existing account.secure.entries.wizard record.
func (c *Client) UpdateAccountSecureEntriesWizard(asew *AccountSecureEntriesWizard) error {
return c.UpdateAccountSecureEntriesWizards([]int64{asew.Id.Get()}, asew)
}
// UpdateAccountSecureEntriesWizards updates existing account.secure.entries.wizard records.
// All records (represented by ids) will be updated by asew values.
func (c *Client) UpdateAccountSecureEntriesWizards(ids []int64, asew *AccountSecureEntriesWizard) error {
return c.Update(AccountSecureEntriesWizardModel, ids, asew, nil)
}
// DeleteAccountSecureEntriesWizard deletes an existing account.secure.entries.wizard record.
func (c *Client) DeleteAccountSecureEntriesWizard(id int64) error {
return c.DeleteAccountSecureEntriesWizards([]int64{id})
}
// DeleteAccountSecureEntriesWizards deletes existing account.secure.entries.wizard records.
func (c *Client) DeleteAccountSecureEntriesWizards(ids []int64) error {
return c.Delete(AccountSecureEntriesWizardModel, ids)
}
// GetAccountSecureEntriesWizard gets account.secure.entries.wizard existing record.
func (c *Client) GetAccountSecureEntriesWizard(id int64) (*AccountSecureEntriesWizard, error) {
asews, err := c.GetAccountSecureEntriesWizards([]int64{id})
if err != nil {
return nil, err
}
return &((*asews)[0]), nil
}
// GetAccountSecureEntriesWizards gets account.secure.entries.wizard existing records.
func (c *Client) GetAccountSecureEntriesWizards(ids []int64) (*AccountSecureEntriesWizards, error) {
asews := &AccountSecureEntriesWizards{}
if err := c.Read(AccountSecureEntriesWizardModel, ids, nil, asews); err != nil {
return nil, err
}
return asews, nil
}
// FindAccountSecureEntriesWizard finds account.secure.entries.wizard record by querying it with criteria.
func (c *Client) FindAccountSecureEntriesWizard(criteria *Criteria) (*AccountSecureEntriesWizard, error) {
asews := &AccountSecureEntriesWizards{}
if err := c.SearchRead(AccountSecureEntriesWizardModel, criteria, NewOptions().Limit(1), asews); err != nil {
return nil, err
}
return &((*asews)[0]), nil
}
// FindAccountSecureEntriesWizards finds account.secure.entries.wizard records by querying it
// and filtering it with criteria and options.
func (c *Client) FindAccountSecureEntriesWizards(criteria *Criteria, options *Options) (*AccountSecureEntriesWizards, error) {
asews := &AccountSecureEntriesWizards{}
if err := c.SearchRead(AccountSecureEntriesWizardModel, criteria, options, asews); err != nil {
return nil, err
}
return asews, nil
}
// FindAccountSecureEntriesWizardIds finds records ids by querying it
// and filtering it with criteria and options.
func (c *Client) FindAccountSecureEntriesWizardIds(criteria *Criteria, options *Options) ([]int64, error) {
return c.Search(AccountSecureEntriesWizardModel, criteria, options)
}
// FindAccountSecureEntriesWizardId finds record id by querying it with criteria.
func (c *Client) FindAccountSecureEntriesWizardId(criteria *Criteria, options *Options) (int64, error) {
ids, err := c.Search(AccountSecureEntriesWizardModel, criteria, options)
if err != nil {
return -1, err
}
return ids[0], nil
}