11package odoo
22
3- import (
4- "fmt"
5- )
6-
73// AccountAccountTag represents account.account.tag model.
84type AccountAccountTag struct {
95 LastUpdate * Time `xmlrpc:"__last_update,omptempty"`
@@ -48,7 +44,7 @@ func (c *Client) CreateAccountAccountTags(aats []*AccountAccountTag) ([]int64, e
4844 for _ , v := range aats {
4945 vv = append (vv , v )
5046 }
51- return c .Create (AccountAccountTagModel , vv )
47+ return c .Create (AccountAccountTagModel , vv , nil )
5248}
5349
5450// UpdateAccountAccountTag updates an existing account.account.tag record.
@@ -59,7 +55,7 @@ func (c *Client) UpdateAccountAccountTag(aat *AccountAccountTag) error {
5955// UpdateAccountAccountTags updates existing account.account.tag records.
6056// All records (represented by ids) will be updated by aat values.
6157func (c * Client ) UpdateAccountAccountTags (ids []int64 , aat * AccountAccountTag ) error {
62- return c .Update (AccountAccountTagModel , ids , aat )
58+ return c .Update (AccountAccountTagModel , ids , aat , nil )
6359}
6460
6561// DeleteAccountAccountTag deletes an existing account.account.tag record.
@@ -78,10 +74,7 @@ func (c *Client) GetAccountAccountTag(id int64) (*AccountAccountTag, error) {
7874 if err != nil {
7975 return nil , err
8076 }
81- if aats != nil && len (* aats ) > 0 {
82- return & ((* aats )[0 ]), nil
83- }
84- return nil , fmt .Errorf ("id %v of account.account.tag not found" , id )
77+ return & ((* aats )[0 ]), nil
8578}
8679
8780// GetAccountAccountTags gets account.account.tag existing records.
@@ -99,10 +92,7 @@ func (c *Client) FindAccountAccountTag(criteria *Criteria) (*AccountAccountTag,
9992 if err := c .SearchRead (AccountAccountTagModel , criteria , NewOptions ().Limit (1 ), aats ); err != nil {
10093 return nil , err
10194 }
102- if aats != nil && len (* aats ) > 0 {
103- return & ((* aats )[0 ]), nil
104- }
105- return nil , fmt .Errorf ("account.account.tag was not found with criteria %v" , criteria )
95+ return & ((* aats )[0 ]), nil
10696}
10797
10898// FindAccountAccountTags finds account.account.tag records by querying it
@@ -118,11 +108,7 @@ func (c *Client) FindAccountAccountTags(criteria *Criteria, options *Options) (*
118108// FindAccountAccountTagIds finds records ids by querying it
119109// and filtering it with criteria and options.
120110func (c * Client ) FindAccountAccountTagIds (criteria * Criteria , options * Options ) ([]int64 , error ) {
121- ids , err := c .Search (AccountAccountTagModel , criteria , options )
122- if err != nil {
123- return []int64 {}, err
124- }
125- return ids , nil
111+ return c .Search (AccountAccountTagModel , criteria , options )
126112}
127113
128114// FindAccountAccountTagId finds record id by querying it with criteria.
@@ -131,8 +117,5 @@ func (c *Client) FindAccountAccountTagId(criteria *Criteria, options *Options) (
131117 if err != nil {
132118 return - 1 , err
133119 }
134- if len (ids ) > 0 {
135- return ids [0 ], nil
136- }
137- return - 1 , fmt .Errorf ("account.account.tag was not found with criteria %v and options %v" , criteria , options )
120+ return ids [0 ], nil
138121}
0 commit comments