-
Notifications
You must be signed in to change notification settings - Fork 64
/
account_bank_statement_import_journal_creation.go
152 lines (136 loc) · 8.54 KB
/
account_bank_statement_import_journal_creation.go
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package odoo
// AccountBankStatementImportJournalCreation represents account.bank.statement.import.journal.creation model.
type AccountBankStatementImportJournalCreation struct {
LastUpdate *Time `xmlrpc:"__last_update,omitempty"`
AccountControlIds *Relation `xmlrpc:"account_control_ids,omitempty"`
AccountSetupBankDataDone *Bool `xmlrpc:"account_setup_bank_data_done,omitempty"`
Active *Bool `xmlrpc:"active,omitempty"`
AtLeastOneInbound *Bool `xmlrpc:"at_least_one_inbound,omitempty"`
AtLeastOneOutbound *Bool `xmlrpc:"at_least_one_outbound,omitempty"`
BankAccNumber *String `xmlrpc:"bank_acc_number,omitempty"`
BankAccountId *Many2One `xmlrpc:"bank_account_id,omitempty"`
BankId *Many2One `xmlrpc:"bank_id,omitempty"`
BankStatementsSource *Selection `xmlrpc:"bank_statements_source,omitempty"`
BelongsToCompany *Bool `xmlrpc:"belongs_to_company,omitempty"`
Code *String `xmlrpc:"code,omitempty"`
Color *Int `xmlrpc:"color,omitempty"`
CompanyId *Many2One `xmlrpc:"company_id,omitempty"`
CreateDate *Time `xmlrpc:"create_date,omitempty"`
CreateUid *Many2One `xmlrpc:"create_uid,omitempty"`
CurrencyId *Many2One `xmlrpc:"currency_id,omitempty"`
DefaultCreditAccountId *Many2One `xmlrpc:"default_credit_account_id,omitempty"`
DefaultDebitAccountId *Many2One `xmlrpc:"default_debit_account_id,omitempty"`
DisplayName *String `xmlrpc:"display_name,omitempty"`
GroupInvoiceLines *Bool `xmlrpc:"group_invoice_lines,omitempty"`
Id *Int `xmlrpc:"id,omitempty"`
InboundPaymentMethodIds *Relation `xmlrpc:"inbound_payment_method_ids,omitempty"`
JournalId *Many2One `xmlrpc:"journal_id,omitempty"`
KanbanDashboard *String `xmlrpc:"kanban_dashboard,omitempty"`
KanbanDashboardGraph *String `xmlrpc:"kanban_dashboard_graph,omitempty"`
LossAccountId *Many2One `xmlrpc:"loss_account_id,omitempty"`
Name *String `xmlrpc:"name,omitempty"`
OutboundPaymentMethodIds *Relation `xmlrpc:"outbound_payment_method_ids,omitempty"`
ProfitAccountId *Many2One `xmlrpc:"profit_account_id,omitempty"`
RefundSequence *Bool `xmlrpc:"refund_sequence,omitempty"`
RefundSequenceId *Many2One `xmlrpc:"refund_sequence_id,omitempty"`
RefundSequenceNumberNext *Int `xmlrpc:"refund_sequence_number_next,omitempty"`
Sequence *Int `xmlrpc:"sequence,omitempty"`
SequenceId *Many2One `xmlrpc:"sequence_id,omitempty"`
SequenceNumberNext *Int `xmlrpc:"sequence_number_next,omitempty"`
ShowOnDashboard *Bool `xmlrpc:"show_on_dashboard,omitempty"`
Type *Selection `xmlrpc:"type,omitempty"`
TypeControlIds *Relation `xmlrpc:"type_control_ids,omitempty"`
UpdatePosted *Bool `xmlrpc:"update_posted,omitempty"`
WriteDate *Time `xmlrpc:"write_date,omitempty"`
WriteUid *Many2One `xmlrpc:"write_uid,omitempty"`
}
// AccountBankStatementImportJournalCreations represents array of account.bank.statement.import.journal.creation model.
type AccountBankStatementImportJournalCreations []AccountBankStatementImportJournalCreation
// AccountBankStatementImportJournalCreationModel is the odoo model name.
const AccountBankStatementImportJournalCreationModel = "account.bank.statement.import.journal.creation"
// Many2One convert AccountBankStatementImportJournalCreation to *Many2One.
func (absijc *AccountBankStatementImportJournalCreation) Many2One() *Many2One {
return NewMany2One(absijc.Id.Get(), "")
}
// CreateAccountBankStatementImportJournalCreation creates a new account.bank.statement.import.journal.creation model and returns its id.
func (c *Client) CreateAccountBankStatementImportJournalCreation(absijc *AccountBankStatementImportJournalCreation) (int64, error) {
ids, err := c.CreateAccountBankStatementImportJournalCreations([]*AccountBankStatementImportJournalCreation{absijc})
if err != nil {
return -1, err
}
if len(ids) == 0 {
return -1, nil
}
return ids[0], nil
}
// CreateAccountBankStatementImportJournalCreations creates a new account.bank.statement.import.journal.creation model and returns its id.
func (c *Client) CreateAccountBankStatementImportJournalCreations(absijcs []*AccountBankStatementImportJournalCreation) ([]int64, error) {
var vv []interface{}
for _, v := range absijcs {
vv = append(vv, v)
}
return c.Create(AccountBankStatementImportJournalCreationModel, vv, nil)
}
// UpdateAccountBankStatementImportJournalCreation updates an existing account.bank.statement.import.journal.creation record.
func (c *Client) UpdateAccountBankStatementImportJournalCreation(absijc *AccountBankStatementImportJournalCreation) error {
return c.UpdateAccountBankStatementImportJournalCreations([]int64{absijc.Id.Get()}, absijc)
}
// UpdateAccountBankStatementImportJournalCreations updates existing account.bank.statement.import.journal.creation records.
// All records (represented by ids) will be updated by absijc values.
func (c *Client) UpdateAccountBankStatementImportJournalCreations(ids []int64, absijc *AccountBankStatementImportJournalCreation) error {
return c.Update(AccountBankStatementImportJournalCreationModel, ids, absijc, nil)
}
// DeleteAccountBankStatementImportJournalCreation deletes an existing account.bank.statement.import.journal.creation record.
func (c *Client) DeleteAccountBankStatementImportJournalCreation(id int64) error {
return c.DeleteAccountBankStatementImportJournalCreations([]int64{id})
}
// DeleteAccountBankStatementImportJournalCreations deletes existing account.bank.statement.import.journal.creation records.
func (c *Client) DeleteAccountBankStatementImportJournalCreations(ids []int64) error {
return c.Delete(AccountBankStatementImportJournalCreationModel, ids)
}
// GetAccountBankStatementImportJournalCreation gets account.bank.statement.import.journal.creation existing record.
func (c *Client) GetAccountBankStatementImportJournalCreation(id int64) (*AccountBankStatementImportJournalCreation, error) {
absijcs, err := c.GetAccountBankStatementImportJournalCreations([]int64{id})
if err != nil {
return nil, err
}
return &((*absijcs)[0]), nil
}
// GetAccountBankStatementImportJournalCreations gets account.bank.statement.import.journal.creation existing records.
func (c *Client) GetAccountBankStatementImportJournalCreations(ids []int64) (*AccountBankStatementImportJournalCreations, error) {
absijcs := &AccountBankStatementImportJournalCreations{}
if err := c.Read(AccountBankStatementImportJournalCreationModel, ids, nil, absijcs); err != nil {
return nil, err
}
return absijcs, nil
}
// FindAccountBankStatementImportJournalCreation finds account.bank.statement.import.journal.creation record by querying it with criteria.
func (c *Client) FindAccountBankStatementImportJournalCreation(criteria *Criteria) (*AccountBankStatementImportJournalCreation, error) {
absijcs := &AccountBankStatementImportJournalCreations{}
if err := c.SearchRead(AccountBankStatementImportJournalCreationModel, criteria, NewOptions().Limit(1), absijcs); err != nil {
return nil, err
}
return &((*absijcs)[0]), nil
}
// FindAccountBankStatementImportJournalCreations finds account.bank.statement.import.journal.creation records by querying it
// and filtering it with criteria and options.
func (c *Client) FindAccountBankStatementImportJournalCreations(criteria *Criteria, options *Options) (*AccountBankStatementImportJournalCreations, error) {
absijcs := &AccountBankStatementImportJournalCreations{}
if err := c.SearchRead(AccountBankStatementImportJournalCreationModel, criteria, options, absijcs); err != nil {
return nil, err
}
return absijcs, nil
}
// FindAccountBankStatementImportJournalCreationIds finds records ids by querying it
// and filtering it with criteria and options.
func (c *Client) FindAccountBankStatementImportJournalCreationIds(criteria *Criteria, options *Options) ([]int64, error) {
return c.Search(AccountBankStatementImportJournalCreationModel, criteria, options)
}
// FindAccountBankStatementImportJournalCreationId finds record id by querying it with criteria.
func (c *Client) FindAccountBankStatementImportJournalCreationId(criteria *Criteria, options *Options) (int64, error) {
ids, err := c.Search(AccountBankStatementImportJournalCreationModel, criteria, options)
if err != nil {
return -1, err
}
return ids[0], nil
}