From 0e3f91b234aa3262c265605643cabc0188d1a16f Mon Sep 17 00:00:00 2001 From: Callum Dickinson Date: Tue, 17 Feb 2026 16:18:41 +1300 Subject: [PATCH] Fix attachment model refs Fix resolving model refs for the `message_main_attachment_name` and `message_main_attachment` fields. --- changelog.d/28.fixed.md | 1 + docs/managers/custom.md | 4 ++-- openstack_odooclient/mixins/record_with_attachment.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog.d/28.fixed.md diff --git a/changelog.d/28.fixed.md b/changelog.d/28.fixed.md new file mode 100644 index 0000000..662601d --- /dev/null +++ b/changelog.d/28.fixed.md @@ -0,0 +1 @@ +Fix attachment model refs diff --git a/docs/managers/custom.md b/docs/managers/custom.md index 9b040c7..8fc4f63 100644 --- a/docs/managers/custom.md +++ b/docs/managers/custom.md @@ -964,13 +964,13 @@ class CustomRecord( # # message_main_attachment_name: Annotated[ # str | None, - # ModelRef("message_main_attachment_name", Attachment), + # ModelRef("message_main_attachment_id", Attachment), # ] # """The name of the main attachment on the record, if there is one.""" # # message_main_attachment: Annotated[ # Attachment | None, - # ModelRef("message_main_attachment", Attachment), + # ModelRef("message_main_attachment_id", Attachment), # ] # """The main attachment on the record, if there is one. # diff --git a/openstack_odooclient/mixins/record_with_attachment.py b/openstack_odooclient/mixins/record_with_attachment.py index 79608e5..d9cc9b8 100644 --- a/openstack_odooclient/mixins/record_with_attachment.py +++ b/openstack_odooclient/mixins/record_with_attachment.py @@ -39,13 +39,13 @@ class RecordWithAttachmentMixin(RecordProtocol[RM], Generic[RM]): message_main_attachment_name: Annotated[ str | None, - ModelRef("message_main_attachment_name", Attachment), + ModelRef("message_main_attachment_id", Attachment), ] """The name of the main attachment on the record, if there is one.""" message_main_attachment: Annotated[ Attachment | None, - ModelRef("message_main_attachment", Attachment), + ModelRef("message_main_attachment_id", Attachment), ] """The main attachment on the record, if there is one.