2
2
3
3
Tested against Laravel 5.7 and Odoo 7.
4
4
5
- More docs to do, examples to wite , and the write interfaces to produce.
5
+ More docs to do, examples to write , and the write interfaces to produce.
6
6
7
7
# Example
8
8
9
9
A very simple example:
10
10
11
11
``` php
12
+ // The facade.
13
+
12
14
use OdooApi;
13
15
16
+ // The default config.
17
+ // getClient() will take other configuration names.
18
+
14
19
$client = OdooApi::getClient();
15
20
16
21
// Note the criteria is a nested list of scalar values.
@@ -26,24 +31,31 @@ $criteria = [
26
31
]
27
32
];
28
33
29
- // First 10 macthing IDs
34
+ // First 10 matching IDs
30
35
31
36
$client->search('res.partner', $criteria, 0, 10, 'id desc')->value()->me['array']
32
37
33
38
// Total count for the criteria.
34
39
35
40
$client->searchCount('res.partner', $criteria);
41
+
42
+ // Read the complete details of two specific partners.
43
+
44
+ $client->read('res.partner', [17858, 17852])->value()->me['array']
36
45
```
37
46
38
47
# TODO
39
48
40
49
* An elegant way to parse the results, as the ` Value ` objects can be
41
50
a little cumbersome.
42
51
For example, we know the ` search() ` result will be an array of
43
- integer model instance IDs, so a simple array of IDs can be returned,
44
- rather than a Value array containing Value integer objects.
52
+ integer model instance IDs, so a simple array or collection of IDs can
53
+ be returned, rather than a Value array containing Value integer objects.
45
54
* Docs on config (this package supports multiple clients, so can connect
46
55
to multiple Odoo instances or as multiple users at the same time).
47
56
* Docs on installation (has a auto discovered provider and facade).
57
+ Includes details on how to publish the config file.
48
58
* The write functions are not written yet (create, write and unlink).
49
59
* The search_read method is not supported yet.
60
+ * The setting of the configuration could be done in a more fluent
61
+ way, as tends to be the Laravel way. But it's no biggie.
0 commit comments