multiwoven-integrations 0.33.3 → 0.33.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcceabc91eee757b5d5d7af2e968d35133415ee1dad963e3bce4191662b55fa2
4
- data.tar.gz: 961c82bdd27327e703d36ab7997b2ccc982d267197932b0184f5375548b4d3bd
3
+ metadata.gz: 988de29d75c6d608b4890a8e9743ecfaa2b9e1a5a38fed0776255e8aa6db1569
4
+ data.tar.gz: c63a9cd96427b9fb6c9e239a47c6f8f1060580388ba72042ae01446f67910cee
5
5
  SHA512:
6
- metadata.gz: 57b6f0c56efd2657d09bd7ca84bca99f9be0d0d05a14e40f7f86a1dad067241394baf23598e0f7ff364cc2303176ae4723a6e13581c53a06bc1d82d4d5bfc5c6
7
- data.tar.gz: b961f9ad1cad9a9e200d286f0a193976a25add771ad475b743021ec504687b6fd853d4adac63faff28864ede906d39043cfb1c4f9bb60f76f4229320ee4cd128
6
+ metadata.gz: fd57b68f40ab659fc690753a4b8bae6cd38d4fe5f760e078fe6c8d23b716c7b134a81570afa743a7b1632c835d042f7d527efa1b9c629d0574436ed23c113f4f
7
+ data.tar.gz: 290f9d5e8da0450a344ca924f54545e514dee71316219fd2d8e0393a5b17b1bea3f6b4622010a8d75791575213c25689c72686c537c03197b3f38f9d8ea273f3
@@ -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],
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.33.3"
5
+ VERSION = "0.33.4"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
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.3
4
+ version: 0.33.4
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-08-12 00:00:00.000000000 Z
11
+ date: 2025-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport