rodoo 0.4.0 → 0.5.0

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: 6296d9a68fe77f42b8a9077cceffbb4f444a72cd2e483e39f5c8e5c2b8e544d7
4
- data.tar.gz: ae9f0cd4ec90a8b199750929c46ca59e93582b03b77be7cf97b72475f45b99a5
3
+ metadata.gz: 34862008f0b02685e929c1c10b16cfa2ad0125fbf37a60190997f7945c747bb9
4
+ data.tar.gz: e947bcd5ac65a7c40cdc9f4bde9c50d6396c6dfdf2705613a273aef39f1585db
5
5
  SHA512:
6
- metadata.gz: 3b66d9c307b38d5eb0f9a3de01917dca2d2469a4019193b56806b3e7a41e8957a136a2f354c9a95eaae3f3e9da093cbcffb053f9bedc5bcff644897d1b7715d5
7
- data.tar.gz: 324854d54a34edf6c2a91ad6f4523db61017ca83dd7a77c6c1f69ba72d452273d93d46ecb0627ccf53bcd3a92866ad8b1c03c7ad20fef6789b38634823581e4a
6
+ metadata.gz: 3c2fb74bc3b31914005b656b1bedf7c016782212d103bcbe089e470480d860d102405d41321a46c1dc3583587f52bc1f1f0534bfeabf380487bc4354994802bb
7
+ data.tar.gz: 712ae40576b4a51b1046d073cb5159087f938324f7e4529a486f27c2674179c0a29737265e92e5fba49a8a33b4554aae70b5d60dbcec52428360fcccff22e851
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.0] - 2026-01-26
4
+
5
+ ### Added
6
+
7
+ - Add `message_subscribe` instance method for subscribing partners to Odoo records
8
+
3
9
  ## [0.4.0] - 2026-01-26
4
10
 
5
11
  ### Added
data/lib/rodoo/model.rb CHANGED
@@ -306,6 +306,30 @@ module Rodoo
306
306
  self.class.execute("message_post", params)
307
307
  end
308
308
 
309
+ # Subscribes partners as followers to the record.
310
+ #
311
+ # @param partner_ids [Array<Integer>] List of partner IDs to subscribe
312
+ # @param subtype_ids [Array<Integer>, nil] Optional list of subtype IDs for notifications
313
+ # @param kwargs [Hash] Additional parameters to pass to the Odoo method
314
+ # @return [Boolean] True on success
315
+ # @raise [Rodoo::Error] If the record hasn't been persisted
316
+ #
317
+ # @example Subscribe contacts to an invoice
318
+ # invoice.message_subscribe(partner_ids: [456, 789])
319
+ #
320
+ def message_subscribe(partner_ids:, subtype_ids: nil, **kwargs)
321
+ raise Error, "Cannot subscribe to a record that hasn't been persisted" unless persisted?
322
+
323
+ params = {
324
+ ids: [id],
325
+ partner_ids: partner_ids,
326
+ subtype_ids: subtype_ids,
327
+ **kwargs
328
+ }.compact
329
+
330
+ self.class.execute("message_subscribe", params)
331
+ end
332
+
309
333
  def inspect
310
334
  "#<#{self.class.name} id=#{id.inspect} #{inspectable_attributes}>"
311
335
  end
data/lib/rodoo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rodoo
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serrano