crisalid_odoo_client 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1f94cc607a4c44b2f17fb2d39610dfbf7642c83136d3b0548635f3eb97a7e63
4
- data.tar.gz: 39614e6b0e80ff458b977abe2eef90e9a1774c287f0547ea12f0f70f460d94b4
3
+ metadata.gz: aa1ac7c04d408162f2b2515d3aed43dd605fc72fbf4b9f40b4e3309d0776d272
4
+ data.tar.gz: 4fc57373699d7c297fe21d35c9922aef5895b34c3f76712e4df6936a3fa43089
5
5
  SHA512:
6
- metadata.gz: 641ae36fbde7e874a074bb4f45cd6096880a04d7b6b687163fb88df88e5b3424605e429f94bdb5b408a76d67bd890d7e5030740cf64953408e4807c17fa3adcd
7
- data.tar.gz: d360912c965fb866e6da669af34d57c3f10616033ef88506c69f44f6a639b6b313f7bf31337252b91ea2e09868cb4b6e773d676b9763fb8a45aaafc3d627efa0
6
+ metadata.gz: 1f69bf1753e6a2e6c9b05ed0f94459c5ba397c7ba0db2e0bb986f5c2b7de65875eab8ed70880284dce2aa95cf00fe23b1b6dbca90610bf011caa6c5efc596a05
7
+ data.tar.gz: '06853d71fb037af5bd952d27a49b254030ad99cfd0500fb1ad48be2c38480f6f7b69e2e88d44dad0d836cc65377f4a5e3dac9113b73acfe872f37d848a662f73'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crisalid_odoo_client (1.0.0)
4
+ crisalid_odoo_client (1.1.0)
5
5
  xmlrpc
6
6
 
7
7
  GEM
@@ -1,5 +1,6 @@
1
1
  require "crisalid_odoo_client/version"
2
2
  require "crisalid_odoo_client/client"
3
+ require "crisalid_odoo_client/table/table"
3
4
  require "crisalid_odoo_client/error/error"
4
5
 
5
6
  module CrisalidOdooClient
@@ -34,19 +34,24 @@ module CrisalidOdooClient
34
34
  @models.execute_kw(@odoo_db, @uid, @odoo_pass, table, 'search', rules, params)
35
35
  end
36
36
 
37
- def search_read(table, rules: [[]], params: {})
37
+ def search_read(table, rules: [[]], params: {}, fields: [])
38
+ params[:fields] = fields if fields.size > 0
39
+
38
40
  @models.execute_kw(@odoo_db, @uid, @odoo_pass, table, 'search_read', rules, params)
39
41
  end
40
42
 
41
- def find(table, ids = [], rules: [[]], params: {}, fields: [], first: false)
43
+ def find(table, ids = [], params: {}, fields: [], first: false)
42
44
  params[:limit] = 1 if first
43
45
  params[:fields] = fields if fields.size > 0
44
46
 
45
- if ids.empty?
46
- search_read(table, rules: rules, params: params)
47
- else
48
- @models.execute_kw(@odoo_db, @uid, @odoo_pass, table, 'read', [ids], params)
49
- end
47
+ @models.execute_kw(@odoo_db, @uid, @odoo_pass, table, 'read', [ids], params)
48
+ end
49
+
50
+ def where(table, rules: [[]], params: {}, fields: [], first: false)
51
+ params[:limit] = 1 if first
52
+ params[:fields] = fields if fields.size > 0
53
+
54
+ search_read(table, rules: rules, params: params)
50
55
  end
51
56
 
52
57
  def create(table, params)
@@ -0,0 +1,4 @@
1
+ module CrisalidOdooClient::Table
2
+ PRODUCT = 'product.product'
3
+ EMPLOYEE = 'hr.employee'
4
+ end
@@ -1,3 +1,3 @@
1
1
  module CrisalidOdooClient
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crisalid_odoo_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Palanchini
@@ -87,6 +87,7 @@ files:
87
87
  - lib/crisalid_odoo_client.rb
88
88
  - lib/crisalid_odoo_client/client.rb
89
89
  - lib/crisalid_odoo_client/error/error.rb
90
+ - lib/crisalid_odoo_client/table/table.rb
90
91
  - lib/crisalid_odoo_client/version.rb
91
92
  homepage: https://github.com/Dakurei/crisalid_odoo_client
92
93
  licenses: