rodoo 0.4.0 → 0.6.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +4 -2
- data/lib/rodoo/model.rb +24 -0
- data/lib/rodoo/models/account.rb +7 -0
- data/lib/rodoo/models/journal.rb +7 -0
- data/lib/rodoo/version.rb +1 -1
- data/lib/rodoo.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25367a4aa5b6dfdce8a36aa02d41fd97609a1e65ee12ceb526c59cdc77d3271f
|
|
4
|
+
data.tar.gz: 9f0fcfd53d2c8ad40ead525cf00ae17e003663f8df2f61ee029de4b0a50cb919
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dae083effa751bda14118ba6ea04937904173c6dda3847c36094f5ea1c377e34ebc59af7bc4e391ce91eae431a36efa5262bc8c2844151aaafc30f1843693d3d
|
|
7
|
+
data.tar.gz: d8747a53fdac8785f8a6ddc8d959bafa8b8ef081cc272e8957c9068501a847bcac84a8fdf7b1bd9b7758e1e59df25c2335f714b399fb1c968c89b10d89d5a93f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.0] - 2026-02-22
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add Account model for Odoo `account.account`
|
|
8
|
+
- Add Journal model for Odoo `account.journal`
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fix typos in README
|
|
13
|
+
|
|
14
|
+
## [0.5.0] - 2026-01-26
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Add `message_subscribe` instance method for subscribing partners to Odoo records
|
|
19
|
+
|
|
3
20
|
## [0.4.0] - 2026-01-26
|
|
4
21
|
|
|
5
22
|
### Added
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rodoo
|
|
2
2
|
|
|
3
|
-
A Ruby gem wrapping Odoo's JSON-
|
|
3
|
+
A Ruby gem wrapping Odoo's external JSON-2 API (Odoo v19+) with an Active Record-style interface.
|
|
4
4
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
@@ -69,7 +69,7 @@ contact = Rodoo::Contact.find_by(name: "Acme Corp", is_company: true)
|
|
|
69
69
|
# Find by string condition
|
|
70
70
|
contact = Rodoo::Contact.find_by("credit_limit > 1000")
|
|
71
71
|
|
|
72
|
-
# Find by raw domain
|
|
72
|
+
# Find by raw Odoo domain
|
|
73
73
|
contact = Rodoo::Contact.find_by([["name", "ilike", "%acme%"]])
|
|
74
74
|
|
|
75
75
|
# Find by attributes (raises NotFoundError if not found)
|
|
@@ -279,6 +279,8 @@ Rodoo includes pre-built models for common Odoo objects:
|
|
|
279
279
|
| `Rodoo::Project` | `project.project` |
|
|
280
280
|
| `Rodoo::AnalyticAccount` | `account.analytic.account` |
|
|
281
281
|
| `Rodoo::AnalyticPlan` | `account.analytic.plan` |
|
|
282
|
+
| `Rodoo::Account` | `account.account` |
|
|
283
|
+
| `Rodoo::Journal` | `account.journal` |
|
|
282
284
|
| `Rodoo::Attachment` | `ir.attachment` |
|
|
283
285
|
| `Rodoo::AccountingEntry` | `account.move` (all types) |
|
|
284
286
|
| `Rodoo::CustomerInvoice` | `account.move` (move_type: out_invoice) |
|
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
data/lib/rodoo.rb
CHANGED
|
@@ -8,6 +8,7 @@ require_relative "rodoo/domain_builder"
|
|
|
8
8
|
require_relative "rodoo/model"
|
|
9
9
|
|
|
10
10
|
module Rodoo
|
|
11
|
+
autoload :Account, "rodoo/models/account"
|
|
11
12
|
autoload :AccountingEntry, "rodoo/models/accounting_entry"
|
|
12
13
|
autoload :AccountingEntryLine, "rodoo/models/accounting_entry_line"
|
|
13
14
|
autoload :AnalyticAccount, "rodoo/models/analytic_account"
|
|
@@ -15,6 +16,7 @@ module Rodoo
|
|
|
15
16
|
autoload :Attachment, "rodoo/models/attachment"
|
|
16
17
|
autoload :CustomerCreditNote, "rodoo/models/customer_credit_note"
|
|
17
18
|
autoload :CustomerInvoice, "rodoo/models/customer_invoice"
|
|
19
|
+
autoload :Journal, "rodoo/models/journal"
|
|
18
20
|
autoload :JournalEntry, "rodoo/models/journal_entry"
|
|
19
21
|
autoload :Contact, "rodoo/models/contact"
|
|
20
22
|
autoload :Product, "rodoo/models/product"
|
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
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rodrigo Serrano
|
|
@@ -46,6 +46,7 @@ files:
|
|
|
46
46
|
- lib/rodoo/domain_builder.rb
|
|
47
47
|
- lib/rodoo/errors.rb
|
|
48
48
|
- lib/rodoo/model.rb
|
|
49
|
+
- lib/rodoo/models/account.rb
|
|
49
50
|
- lib/rodoo/models/accounting_entry.rb
|
|
50
51
|
- lib/rodoo/models/accounting_entry_line.rb
|
|
51
52
|
- lib/rodoo/models/analytic_account.rb
|
|
@@ -54,6 +55,7 @@ files:
|
|
|
54
55
|
- lib/rodoo/models/contact.rb
|
|
55
56
|
- lib/rodoo/models/customer_credit_note.rb
|
|
56
57
|
- lib/rodoo/models/customer_invoice.rb
|
|
58
|
+
- lib/rodoo/models/journal.rb
|
|
57
59
|
- lib/rodoo/models/journal_entry.rb
|
|
58
60
|
- lib/rodoo/models/product.rb
|
|
59
61
|
- lib/rodoo/models/project.rb
|