Skip to content

fix: support string ID in OdooRelationDenormalizer - #10

Merged
Prometee merged 1 commit into
masterfrom
fix/string-id-support
Apr 8, 2026
Merged

Prometee merged 1 commit into
masterfrom
fix/string-id-support

Conversation

@Prometee

@Prometee Prometee commented Apr 8, 2026

Copy link
Copy Markdown
Member

Description

The Odoo API is not always consistent and can sometimes return an ID as a string instead of an integer.

Changes

  • Add string type to the $id variable annotation in OdooRelationDenormalizer
  • Cast $id to int before passing it to the OdooRelation constructor
  • Add OdooRelationDenormalizerTest with comprehensive test cases

Tests

  • Standard integer ID
  • String ID (the fixed case)
  • ID with empty display_name
  • display_name set to false
  • Invalid ID (non-numeric) → exception
  • Null ID → exception
  • False ID → exception

- Add string type to $id variable annotation
- Cast $id to int before passing to OdooRelation constructor
- Add OdooRelationDenormalizerTest with comprehensive test cases
@Prometee
Prometee merged commit 2a6dfb8 into master Apr 8, 2026
42 checks passed
@Prometee
Prometee deleted the fix/string-id-support branch April 8, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant