multiwoven-integrations 0.33.3 → 0.33.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/multiwoven/integrations/destination/odoo/client.rb +12 -0
- data/lib/multiwoven/integrations/rollout.rb +1 -1
- data/lib/multiwoven/integrations/source/google_drive/client.rb +3 -1
- data/lib/multiwoven/integrations/source/google_drive/config/catalog.json +3 -0
- data/lib/multiwoven/integrations/source/google_drive/config/spec.json +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d146581949eb180b91b87a724b1192069852c20afc83cd067a0b663ec44f5434
|
4
|
+
data.tar.gz: 74e443bc300959a714b12d32f6448a3e22c4ae4e24d92429205e9c005c8c7fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 030b3e9029fadd5d72c30da9921745765af620d4e779ffdfcfa7ebe7d6e2b249c0c02fb0aa5e5cafcfb2eb31c07afe6b576ba512e86aec241f30c3e444bbb7a2
|
7
|
+
data.tar.gz: a09739de81f3a9eb107c2582fc97674af702c5bafec3c30bbfce4d5ddc4d9dfa8b0c213d9c621c5038fc557dfd393e1c172a3dfdfd1b55a5e0fd4f3d3f5ef7eb
|
@@ -40,6 +40,7 @@ module Multiwoven::Integrations::Destination
|
|
40
40
|
records.each do |record|
|
41
41
|
logger.debug("ODOO:WRITE:#{model} sync_id = #{sync_config.sync_id} sync_run_id = #{sync_config.sync_run_id}")
|
42
42
|
begin
|
43
|
+
record = format_record(record, sync_config.stream.json_schema)
|
43
44
|
response = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
|
44
45
|
model, "create", [record])
|
45
46
|
write_success += 1
|
@@ -67,6 +68,17 @@ module Multiwoven::Integrations::Destination
|
|
67
68
|
|
68
69
|
private
|
69
70
|
|
71
|
+
def format_record(record, json_schema)
|
72
|
+
json_schema = json_schema.with_indifferent_access
|
73
|
+
properties = json_schema["properties"]
|
74
|
+
record.each_key do |key|
|
75
|
+
data_type = properties[key]["type"]
|
76
|
+
record[key] = record[key].to_i if data_type == "many2one"
|
77
|
+
record[key] = JSON.parse(record[key]) if data_type == "one2many"
|
78
|
+
end
|
79
|
+
record
|
80
|
+
end
|
81
|
+
|
70
82
|
def create_streams(connection_config, models)
|
71
83
|
models.map do |model|
|
72
84
|
fields = @client.execute_kw(connection_config[:database], @uid, connection_config[:password],
|
@@ -144,7 +144,7 @@ module Multiwoven::Integrations::Source
|
|
144
144
|
|
145
145
|
def select_columns(query)
|
146
146
|
columns = query.match(/SELECT (.*) FROM/)[1]
|
147
|
-
all_columns = %w[line_items id file_name exception] + TEXTRACT_SUMMARY_FIELDS.keys
|
147
|
+
all_columns = %w[line_items id file_name exception results] + TEXTRACT_SUMMARY_FIELDS.keys
|
148
148
|
@options[:fields] = all_columns if @options[:fields].empty?
|
149
149
|
|
150
150
|
return @options[:fields] if columns.include?("*")
|
@@ -162,6 +162,7 @@ module Multiwoven::Integrations::Source
|
|
162
162
|
invoice["id"] = file.id if columns.any?("id")
|
163
163
|
invoice["file_name"] = file.name if columns.any?("file_name")
|
164
164
|
invoice["exception"] = "" if columns.any?("exception")
|
165
|
+
invoice["results"] = {} if columns.any?("results")
|
165
166
|
invoice
|
166
167
|
end
|
167
168
|
|
@@ -202,6 +203,7 @@ module Multiwoven::Integrations::Source
|
|
202
203
|
end
|
203
204
|
end
|
204
205
|
invoice["line_items"] = invoice["line_items"].to_json
|
206
|
+
invoice["results"] = results.to_json if invoice.key?("results")
|
205
207
|
invoice.transform_keys(&:to_sym)
|
206
208
|
end
|
207
209
|
|
@@ -109,7 +109,8 @@
|
|
109
109
|
{ "const": "invoice_total", "title": "Invoice/Receipt Total" },
|
110
110
|
{ "const": "purchase_order", "title": "Purchase Order Number" },
|
111
111
|
{ "const": "line_items", "title": "Invoice Line Items (Code, Description, Quantity, Unit Price, Total Price)"},
|
112
|
-
{ "const": "vendor_name", "title": "Vendor Name" }
|
112
|
+
{ "const": "vendor_name", "title": "Vendor Name" },
|
113
|
+
{ "const": "results", "title": "Parsing Results" }
|
113
114
|
]
|
114
115
|
},
|
115
116
|
"uniqueItems": true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiwoven-integrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.33.
|
4
|
+
version: 0.33.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subin T P
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|