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.