Class: Kangaroo::Util::Proxy::Object
- Inherits:
-
Kangaroo::Util::Proxy
- Object
- Rapuncel::Proxy
- Kangaroo::Util::Proxy
- Kangaroo::Util::Proxy::Object
- Defined in:
- lib/kangaroo/util/proxy/object.rb
Instance Method Summary collapse
-
#call!(name, *args) ⇒ Object
Call function via execute on OpenERPs object service.
-
#copy(id, default = nil, context = nil) ⇒ Object
Copy a record.
-
#create(attributes, context = nil) ⇒ Object
Create a new record.
-
#default_get(fields = nil, context = nil) ⇒ Hash
Get default values for a model.
-
#exists(ids, context = nil) ⇒ boolean
Check if records with given ids exist.
-
#fields_get(fields = nil, context = {}) ⇒ Hash
Get for a model.
-
#get_xml_id(ids) ⇒ Hash
Get xml ids for records.
-
#name_get(ids, context = nil) ⇒ Array<Array>
Get names of records for to-many relationships.
-
#name_search(name = '', args = nil, operator = 'ilike', context = nil, limit = 100) ⇒ Object
Search for records by name.
-
#read(ids, fields = [], context = nil) ⇒ Array
Read fields from records.
-
#read_group(domain, fields, groupby, offset = 0, limit = nil, order = nil) ⇒ Array
Read records grouped by a field.
-
#read_perm(ids, context = nil, details = false) ⇒ Array
Read metadata for records, including - create user - create date - write user - write date - xml id.
-
#search(conditions, offset = 0, limit = nil, order = nil, context = nil, count = false) ⇒ Object
Search for records.
-
#unlink(ids, context = nil) ⇒ Object
Delete records.
-
#write(ids, values, context = nil) ⇒ Object
Update records.
Methods inherited from Kangaroo::Util::Proxy
Instance Method Details
#call!(name, *args) ⇒ Object
Call function via execute on OpenERPs object service.
8 9 10 |
# File 'lib/kangaroo/util/proxy/object.rb', line 8 def call! name, *args super :execute, name, *args end |
#copy(id, default = nil, context = nil) ⇒ Object
Copy a record
72 73 74 |
# File 'lib/kangaroo/util/proxy/object.rb', line 72 def copy id, default = nil, context = nil call! :copy, id, default, context end |
#create(attributes, context = nil) ⇒ Object
Create a new record
97 98 99 |
# File 'lib/kangaroo/util/proxy/object.rb', line 97 def create attributes, context = nil call! :create, attributes, context end |
#default_get(fields = nil, context = nil) ⇒ Hash
Get default values for a model
26 27 28 |
# File 'lib/kangaroo/util/proxy/object.rb', line 26 def default_get fields = nil, context = nil call! :default_get, fields, context end |
#exists(ids, context = nil) ⇒ boolean
Check if records with given ids exist
81 82 83 |
# File 'lib/kangaroo/util/proxy/object.rb', line 81 def exists ids, context = nil call! :exists, ids, context end |
#fields_get(fields = nil, context = {}) ⇒ Hash
Get for a model
17 18 19 |
# File 'lib/kangaroo/util/proxy/object.rb', line 17 def fields_get fields = nil, context = {} call! :fields_get, fields, context end |
#get_xml_id(ids) ⇒ Hash
Get xml ids for records
89 90 91 |
# File 'lib/kangaroo/util/proxy/object.rb', line 89 def get_xml_id ids call! :get_xml_id, ids end |
#name_get(ids, context = nil) ⇒ Array<Array>
Get names of records for to-many relationships
35 36 37 |
# File 'lib/kangaroo/util/proxy/object.rb', line 35 def name_get ids, context = nil call! :name_get, ids, context end |
#name_search(name = '', args = nil, operator = 'ilike', context = nil, limit = 100) ⇒ Object
Search for records by name
47 48 49 |
# File 'lib/kangaroo/util/proxy/object.rb', line 47 def name_search name = '', args = nil, operator = 'ilike', context = nil, limit = 100 call! :name_search, name, args, operator, context, limit end |
#read(ids, fields = [], context = nil) ⇒ Array
Read fields from records
117 118 119 |
# File 'lib/kangaroo/util/proxy/object.rb', line 117 def read ids, fields = [], context = nil call! :read, ids, fields end |
#read_group(domain, fields, groupby, offset = 0, limit = nil, order = nil) ⇒ Array
Read records grouped by a field
147 148 149 |
# File 'lib/kangaroo/util/proxy/object.rb', line 147 def read_group domain, fields, groupby, offset = 0, limit = nil, order = nil call! :read_group, domain, fields, groupby, offset, limit, order end |
#read_perm(ids, context = nil, details = false) ⇒ Array
Read metadata for records, including
- create user
- create date
- write user
- write date
- xml id
62 63 64 |
# File 'lib/kangaroo/util/proxy/object.rb', line 62 def read_perm ids, context = nil, details = false call! :read_perm, ids, context, details end |
#search(conditions, offset = 0, limit = nil, order = nil, context = nil, count = false) ⇒ Object
Search for records
107 108 109 |
# File 'lib/kangaroo/util/proxy/object.rb', line 107 def search conditions, offset = 0, limit = nil, order = nil, context = nil, count = false call! :search, conditions, offset, limit, order, context, count end |
#unlink(ids, context = nil) ⇒ Object
Delete records
134 135 136 |
# File 'lib/kangaroo/util/proxy/object.rb', line 134 def unlink ids, context = nil call! :unlink, ids, context end |
#write(ids, values, context = nil) ⇒ Object
Update records
126 127 128 |
# File 'lib/kangaroo/util/proxy/object.rb', line 126 def write ids, values, context = nil call! :write, ids, values, context end |